-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds v2 StorageComponent and allows the server to use it directly (#1729
) This adds a type for the v2 StorageComponent so that future storage implementations can be made without a compile dependency on the v1 jar. This is internal until everything is verified.
- Loading branch information
1 parent
f895b83
commit 8aeea3a
Showing
40 changed files
with
543 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
zipkin-server/src/test/java/zipkin/server/ZipkinServerV2StorageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Copyright 2015-2017 The OpenZipkin Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License | ||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
* or implied. See the License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package zipkin.server; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.springframework.boot.actuate.health.HealthAggregator; | ||
import org.springframework.boot.actuate.health.OrderedHealthAggregator; | ||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; | ||
import org.springframework.context.annotation.AnnotationConfigApplicationContext; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import zipkin.internal.v2.storage.InMemoryStorage; | ||
import zipkin.internal.v2.storage.StorageComponent; | ||
|
||
public class ZipkinServerV2StorageTest { | ||
AnnotationConfigApplicationContext context; | ||
|
||
@Before public void init() { | ||
context = new AnnotationConfigApplicationContext(); | ||
} | ||
|
||
@After public void close() { | ||
if (context != null) context.close(); | ||
} | ||
|
||
@Test public void adaptsStorageComponent() { | ||
context.register( | ||
PropertyPlaceholderAutoConfiguration.class, | ||
V2Storage.class, | ||
ZipkinServerConfiguration.class); | ||
context.refresh(); | ||
|
||
context.getBean(zipkin.storage.StorageComponent.class); | ||
} | ||
|
||
@Configuration | ||
public static class V2Storage { | ||
@Bean public HealthAggregator healthAggregator() { | ||
return new OrderedHealthAggregator(); | ||
} | ||
|
||
@Bean public StorageComponent component() { | ||
return InMemoryStorage.newBuilder().build(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.