-
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.
- Loading branch information
Adrian Cole
committed
Aug 30, 2017
1 parent
6421115
commit fc98b91
Showing
8 changed files
with
691 additions
and
13 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
71 changes: 71 additions & 0 deletions
71
zipkin/src/main/java/zipkin/internal/V2InMemoryStorage.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,71 @@ | ||
/** | ||
* 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.internal; | ||
|
||
import java.io.IOException; | ||
import zipkin.internal.v2.storage.InMemoryStorage; | ||
|
||
public final class V2InMemoryStorage extends V2StorageComponent { | ||
|
||
public static Builder newBuilder() { | ||
return new V2InMemoryStorage.Builder(); | ||
} | ||
|
||
public static final class Builder implements zipkin.storage.StorageComponent.Builder { | ||
final InMemoryStorage.Builder delegate = InMemoryStorage.newBuilder(); | ||
|
||
@Override public Builder strictTraceId(boolean strictTraceId) { | ||
delegate.strictTraceId(strictTraceId); | ||
return this; | ||
} | ||
|
||
/** Eldest traces are removed to ensure spans in memory don't exceed this value */ | ||
public Builder maxSpanCount(int maxSpanCount) { | ||
delegate.maxSpanCount(maxSpanCount); | ||
return this; | ||
} | ||
|
||
@Override public V2InMemoryStorage build() { | ||
return new V2InMemoryStorage(delegate.build()); | ||
} | ||
|
||
Builder() { | ||
} | ||
} | ||
|
||
final InMemoryStorage delegate; | ||
|
||
V2InMemoryStorage(InMemoryStorage delegate) { | ||
this.delegate = delegate; | ||
} | ||
|
||
@Override public InMemoryStorage v2SpanStore() { | ||
return delegate; | ||
} | ||
|
||
@Override public InMemoryStorage v2SpanConsumer() { | ||
return delegate; | ||
} | ||
|
||
@Override public CheckResult check() { | ||
return CheckResult.OK; | ||
} | ||
|
||
void clear() { | ||
delegate.clear(); | ||
} | ||
|
||
@Override public void close() throws IOException { | ||
} | ||
} |
Oops, something went wrong.