-
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.
WIP: attempts support of Elasticsearch 7.x
There are multiple issues to resolve, not just the colon banning. See https://www.elastic.co/guide/en/elasticsearch/reference/7.x/breaking-changes-7.0.html See #2219
- Loading branch information
Adrian Cole
committed
Feb 18, 2019
1 parent
8fe80bf
commit bec429b
Showing
7 changed files
with
207 additions
and
27 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
143 changes: 143 additions & 0 deletions
143
...asticsearch/src/test/java/zipkin2/elasticsearch/integration/ITElasticsearchStorageV7.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,143 @@ | ||
/* | ||
* Copyright 2015-2019 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 zipkin2.elasticsearch.integration; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
import org.junit.Before; | ||
import org.junit.ClassRule; | ||
import org.junit.Ignore; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.experimental.runners.Enclosed; | ||
import org.junit.rules.TestName; | ||
import org.junit.runner.RunWith; | ||
import zipkin2.Span; | ||
import zipkin2.elasticsearch.ElasticsearchStorage; | ||
import zipkin2.elasticsearch.InternalForTests; | ||
import zipkin2.storage.StorageComponent; | ||
|
||
import static zipkin2.elasticsearch.integration.ElasticsearchStorageRule.index; | ||
|
||
@RunWith(Enclosed.class) | ||
public class ITElasticsearchStorageV7 { | ||
|
||
static ElasticsearchStorageRule classRule() { | ||
return new ElasticsearchStorageRule("openzipkin/zipkin-elasticsearch7:2.12.1", | ||
"test_elasticsearch3"); | ||
} | ||
|
||
public static class ITSpanStore extends zipkin2.storage.ITSpanStore { | ||
@ClassRule public static ElasticsearchStorageRule backend = classRule(); | ||
@Rule public TestName testName = new TestName(); | ||
|
||
ElasticsearchStorage storage; | ||
|
||
@Before public void connect() { | ||
storage = backend.computeStorageBuilder().index(index(testName)).build(); | ||
} | ||
|
||
@Override protected StorageComponent storage() { | ||
return storage; | ||
} | ||
|
||
// we don't map this in elasticsearch | ||
@Test @Ignore @Override public void getSpanNames_mapsNameToRemoteServiceName() { | ||
} | ||
|
||
@Before @Override public void clear() throws IOException { | ||
storage.clear(); | ||
} | ||
} | ||
|
||
public static class ITSearchEnabledFalse extends zipkin2.storage.ITSearchEnabledFalse { | ||
@ClassRule public static ElasticsearchStorageRule backend = classRule(); | ||
@Rule public TestName testName = new TestName(); | ||
|
||
ElasticsearchStorage storage; | ||
|
||
@Before public void connect() { | ||
storage = backend.computeStorageBuilder().index(index(testName)) | ||
.searchEnabled(false).build(); | ||
} | ||
|
||
@Override protected StorageComponent storage() { | ||
return storage; | ||
} | ||
|
||
@Before @Override public void clear() throws IOException { | ||
storage.clear(); | ||
} | ||
} | ||
|
||
public static class ITAutocompleteTags extends zipkin2.storage.ITAutocompleteTags { | ||
@ClassRule public static ElasticsearchStorageRule backend = classRule(); | ||
@Rule public TestName testName = new TestName(); | ||
|
||
@Override protected StorageComponent.Builder storageBuilder() { | ||
return backend.computeStorageBuilder().index(index(testName)); | ||
} | ||
|
||
@Before @Override public void clear() throws IOException { | ||
((ElasticsearchStorage) storage).clear(); | ||
} | ||
} | ||
|
||
public static class ITStrictTraceIdFalse extends zipkin2.storage.ITStrictTraceIdFalse { | ||
@ClassRule public static ElasticsearchStorageRule backend = classRule(); | ||
@Rule public TestName testName = new TestName(); | ||
|
||
ElasticsearchStorage storage; | ||
|
||
@Before public void connect() { | ||
storage = backend.computeStorageBuilder().index(index(testName)).strictTraceId(false).build(); | ||
} | ||
|
||
@Override protected StorageComponent storage() { | ||
return storage; | ||
} | ||
|
||
@Before @Override public void clear() throws IOException { | ||
storage.clear(); | ||
} | ||
} | ||
|
||
public static class ITDependencies extends zipkin2.storage.ITDependencies { | ||
@ClassRule public static ElasticsearchStorageRule backend = classRule(); | ||
@Rule public TestName testName = new TestName(); | ||
|
||
ElasticsearchStorage storage; | ||
|
||
@Before public void connect() { | ||
storage = backend.computeStorageBuilder().index(index(testName)).build(); | ||
} | ||
|
||
@Override protected StorageComponent storage() { | ||
return storage; | ||
} | ||
|
||
/** | ||
* The current implementation does not include dependency aggregation. It includes retrieval of | ||
* pre-aggregated links, usually made via zipkin-dependencies | ||
*/ | ||
@Override protected void processDependencies(List<Span> spans) throws Exception { | ||
aggregateLinks(spans).forEach( | ||
(midnight, links) -> InternalForTests.writeDependencyLinks(storage, links, midnight)); | ||
} | ||
|
||
@Before @Override public void clear() throws IOException { | ||
storage.clear(); | ||
} | ||
} | ||
} |