id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
132,200 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java | PravegaTablesStoreHelper.removeEntries | public CompletableFuture<Void> removeEntries(String tableName, Collection<String> keys) {
log.trace("remove entry called for : {} keys : {}", tableName, keys);
List<TableKey<byte[]>> listOfKeys = keys.stream().map(x -> new TableKeyImpl<>(x.getBytes(Charsets.UTF_8), null)).collect(Collectors.toList());
... | java | public CompletableFuture<Void> removeEntries(String tableName, Collection<String> keys) {
log.trace("remove entry called for : {} keys : {}", tableName, keys);
List<TableKey<byte[]>> listOfKeys = keys.stream().map(x -> new TableKeyImpl<>(x.getBytes(Charsets.UTF_8), null)).collect(Collectors.toList());
... | [
"public",
"CompletableFuture",
"<",
"Void",
">",
"removeEntries",
"(",
"String",
"tableName",
",",
"Collection",
"<",
"String",
">",
"keys",
")",
"{",
"log",
".",
"trace",
"(",
"\"remove entry called for : {} keys : {}\"",
",",
"tableName",
",",
"keys",
")",
";"... | Removes a batch of entries from the table store. Ignores data not found exception and treats it as success.
If table store throws dataNotFound for a subset of entries, there is no way for this method to disambiguate.
So it is the responsibility of the caller to use this api if they are guaranteed to always attempt to
r... | [
"Removes",
"a",
"batch",
"of",
"entries",
"from",
"the",
"table",
"store",
".",
"Ignores",
"data",
"not",
"found",
"exception",
"and",
"treats",
"it",
"as",
"success",
".",
"If",
"table",
"store",
"throws",
"dataNotFound",
"for",
"a",
"subset",
"of",
"entr... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L324-L332 |
132,201 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java | PravegaTablesStoreHelper.getKeysPaginated | public CompletableFuture<Map.Entry<ByteBuf, List<String>>> getKeysPaginated(String tableName, ByteBuf continuationToken, int limit) {
log.trace("get keys paginated called for : {}", tableName);
return withRetries(() ->
segmentHelper.readTableKeys(tableName, limit, IteratorState.fromByt... | java | public CompletableFuture<Map.Entry<ByteBuf, List<String>>> getKeysPaginated(String tableName, ByteBuf continuationToken, int limit) {
log.trace("get keys paginated called for : {}", tableName);
return withRetries(() ->
segmentHelper.readTableKeys(tableName, limit, IteratorState.fromByt... | [
"public",
"CompletableFuture",
"<",
"Map",
".",
"Entry",
"<",
"ByteBuf",
",",
"List",
"<",
"String",
">",
">",
">",
"getKeysPaginated",
"(",
"String",
"tableName",
",",
"ByteBuf",
"continuationToken",
",",
"int",
"limit",
")",
"{",
"log",
".",
"trace",
"("... | Method to get paginated list of keys with a continuation token.
@param tableName tableName
@param continuationToken previous continuationToken
@param limit limit on number of keys to retrieve
@return CompletableFuture which when completed will have a list of keys of size less than or equal to limit and
a new Continutio... | [
"Method",
"to",
"get",
"paginated",
"list",
"of",
"keys",
"with",
"a",
"continuation",
"token",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L342-L354 |
132,202 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java | PravegaTablesStoreHelper.getEntriesPaginated | public <T> CompletableFuture<Map.Entry<ByteBuf, List<Map.Entry<String, VersionedMetadata<T>>>>> getEntriesPaginated(
String tableName, ByteBuf continuationToken, int limit,
Function<byte[], T> fromBytes) {
log.trace("get entries paginated called for : {}", tableName);
return wit... | java | public <T> CompletableFuture<Map.Entry<ByteBuf, List<Map.Entry<String, VersionedMetadata<T>>>>> getEntriesPaginated(
String tableName, ByteBuf continuationToken, int limit,
Function<byte[], T> fromBytes) {
log.trace("get entries paginated called for : {}", tableName);
return wit... | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"Map",
".",
"Entry",
"<",
"ByteBuf",
",",
"List",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"VersionedMetadata",
"<",
"T",
">",
">",
">",
">",
">",
"getEntriesPaginated",
"(",
"String",
"tableName",
... | Method to get paginated list of entries with a continuation token.
@param tableName tableName
@param continuationToken previous continuationToken
@param limit limit on number of entries to retrieve
@param fromBytes function to deserialize byte array into object of type T
@param <T> type of deserialized entry values
@re... | [
"Method",
"to",
"get",
"paginated",
"list",
"of",
"entries",
"with",
"a",
"continuation",
"token",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L366-L383 |
132,203 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java | PravegaTablesStoreHelper.getEntriesWithFilter | public <K, V> CompletableFuture<Map<K, V>> getEntriesWithFilter(
String table, Function<String, K> fromStringKey,
Function<byte[], V> fromBytesValue, BiFunction<K, V, Boolean> filter, int limit) {
Map<K, V> result = new ConcurrentHashMap<>();
AtomicBoolean canContinue = new Atomi... | java | public <K, V> CompletableFuture<Map<K, V>> getEntriesWithFilter(
String table, Function<String, K> fromStringKey,
Function<byte[], V> fromBytesValue, BiFunction<K, V, Boolean> filter, int limit) {
Map<K, V> result = new ConcurrentHashMap<>();
AtomicBoolean canContinue = new Atomi... | [
"public",
"<",
"K",
",",
"V",
">",
"CompletableFuture",
"<",
"Map",
"<",
"K",
",",
"V",
">",
">",
"getEntriesWithFilter",
"(",
"String",
"table",
",",
"Function",
"<",
"String",
",",
"K",
">",
"fromStringKey",
",",
"Function",
"<",
"byte",
"[",
"]",
... | Method to retrieve a collection of entries bounded by the specified limit size that satisfy the supplied filter.
This function makes calls into segment store and includes entries that satisfy the supplied
predicate. It makes repeated paginated calls into segment store until it has either collected deseried number
of en... | [
"Method",
"to",
"retrieve",
"a",
"collection",
"of",
"entries",
"bounded",
"by",
"the",
"specified",
"limit",
"size",
"that",
"satisfy",
"the",
"supplied",
"filter",
".",
"This",
"function",
"makes",
"calls",
"into",
"segment",
"store",
"and",
"includes",
"ent... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L399-L432 |
132,204 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java | PravegaTablesStoreHelper.getAllKeys | public AsyncIterator<String> getAllKeys(String tableName) {
return new ContinuationTokenAsyncIterator<>(token -> getKeysPaginated(tableName, token, 1000)
.thenApplyAsync(result -> {
token.release();
return new AbstractMap.SimpleEntry<>(result.getKey(), res... | java | public AsyncIterator<String> getAllKeys(String tableName) {
return new ContinuationTokenAsyncIterator<>(token -> getKeysPaginated(tableName, token, 1000)
.thenApplyAsync(result -> {
token.release();
return new AbstractMap.SimpleEntry<>(result.getKey(), res... | [
"public",
"AsyncIterator",
"<",
"String",
">",
"getAllKeys",
"(",
"String",
"tableName",
")",
"{",
"return",
"new",
"ContinuationTokenAsyncIterator",
"<>",
"(",
"token",
"->",
"getKeysPaginated",
"(",
"tableName",
",",
"token",
",",
"1000",
")",
".",
"thenApplyA... | Method to retrieve all keys in the table. It returns an asyncIterator which can be used to iterate over the returned keys.
@param tableName table name
@return AsyncIterator that can be used to iterate over keys in the table. | [
"Method",
"to",
"retrieve",
"all",
"keys",
"in",
"the",
"table",
".",
"It",
"returns",
"an",
"asyncIterator",
"which",
"can",
"be",
"used",
"to",
"iterate",
"over",
"the",
"returned",
"keys",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L439-L446 |
132,205 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java | PravegaTablesStoreHelper.getAllEntries | public <T> AsyncIterator<Map.Entry<String, VersionedMetadata<T>>> getAllEntries(String tableName, Function<byte[], T> fromBytes) {
return new ContinuationTokenAsyncIterator<>(token -> getEntriesPaginated(tableName, token, 1000, fromBytes)
.thenApplyAsync(result -> {
token.rel... | java | public <T> AsyncIterator<Map.Entry<String, VersionedMetadata<T>>> getAllEntries(String tableName, Function<byte[], T> fromBytes) {
return new ContinuationTokenAsyncIterator<>(token -> getEntriesPaginated(tableName, token, 1000, fromBytes)
.thenApplyAsync(result -> {
token.rel... | [
"public",
"<",
"T",
">",
"AsyncIterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"VersionedMetadata",
"<",
"T",
">",
">",
">",
"getAllEntries",
"(",
"String",
"tableName",
",",
"Function",
"<",
"byte",
"[",
"]",
",",
"T",
">",
"fromBytes",
")",
... | Method to retrieve all entries in the table. It returns an asyncIterator which can be used to iterate over the returned entries.
@param tableName table name
@param fromBytes deserialization function to deserialize returned value.
@param <T> Type of value
@return AsyncIterator that can be used to iterate over keys in th... | [
"Method",
"to",
"retrieve",
"all",
"entries",
"in",
"the",
"table",
".",
"It",
"returns",
"an",
"asyncIterator",
"which",
"can",
"be",
"used",
"to",
"iterate",
"over",
"the",
"returned",
"entries",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L455-L462 |
132,206 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLogFactory.java | BookKeeperLogFactory.initialize | @Override
public void initialize() throws DurableDataLogException {
Preconditions.checkState(this.bookKeeper.get() == null, "BookKeeperLogFactory is already initialized.");
try {
this.bookKeeper.set(startBookKeeperClient());
} catch (IllegalArgumentException | NullPointerExceptio... | java | @Override
public void initialize() throws DurableDataLogException {
Preconditions.checkState(this.bookKeeper.get() == null, "BookKeeperLogFactory is already initialized.");
try {
this.bookKeeper.set(startBookKeeperClient());
} catch (IllegalArgumentException | NullPointerExceptio... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
")",
"throws",
"DurableDataLogException",
"{",
"Preconditions",
".",
"checkState",
"(",
"this",
".",
"bookKeeper",
".",
"get",
"(",
")",
"==",
"null",
",",
"\"BookKeeperLogFactory is already initialized.\"",
")",... | region DurableDataLogFactory Implementation | [
"region",
"DurableDataLogFactory",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLogFactory.java#L80-L98 |
132,207 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLogFactory.java | BookKeeperLogFactory.createDebugLogWrapper | public DebugLogWrapper createDebugLogWrapper(int logId) {
Preconditions.checkState(this.bookKeeper.get() != null, "BookKeeperLogFactory is not initialized.");
return new DebugLogWrapper(logId, this.zkClient, this.bookKeeper.get(), this.config, this.executor);
} | java | public DebugLogWrapper createDebugLogWrapper(int logId) {
Preconditions.checkState(this.bookKeeper.get() != null, "BookKeeperLogFactory is not initialized.");
return new DebugLogWrapper(logId, this.zkClient, this.bookKeeper.get(), this.config, this.executor);
} | [
"public",
"DebugLogWrapper",
"createDebugLogWrapper",
"(",
"int",
"logId",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"this",
".",
"bookKeeper",
".",
"get",
"(",
")",
"!=",
"null",
",",
"\"BookKeeperLogFactory is not initialized.\"",
")",
";",
"return",
"n... | Creates a new DebugLogWrapper that can be used for debugging purposes. This should not be used for regular operations.
@param logId Id of the Log to create a wrapper for.
@return A new instance of the DebugLogWrapper class. | [
"Creates",
"a",
"new",
"DebugLogWrapper",
"that",
"can",
"be",
"used",
"for",
"debugging",
"purposes",
".",
"This",
"should",
"not",
"be",
"used",
"for",
"regular",
"operations",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLogFactory.java#L112-L115 |
132,208 | pravega/pravega | shared/metrics/src/main/java/io/pravega/shared/MetricsTags.java | MetricsTags.getSegmentBaseName | private static String getSegmentBaseName(String segmentQualifiedName) {
int endOfStreamNamePos = segmentQualifiedName.lastIndexOf(TRANSACTION_DELIMITER);
if (endOfStreamNamePos < 0 || endOfStreamNamePos + TRANSACTION_DELIMITER.length() + TRANSACTION_ID_LENGTH > segmentQualifiedName.length()) {
... | java | private static String getSegmentBaseName(String segmentQualifiedName) {
int endOfStreamNamePos = segmentQualifiedName.lastIndexOf(TRANSACTION_DELIMITER);
if (endOfStreamNamePos < 0 || endOfStreamNamePos + TRANSACTION_DELIMITER.length() + TRANSACTION_ID_LENGTH > segmentQualifiedName.length()) {
... | [
"private",
"static",
"String",
"getSegmentBaseName",
"(",
"String",
"segmentQualifiedName",
")",
"{",
"int",
"endOfStreamNamePos",
"=",
"segmentQualifiedName",
".",
"lastIndexOf",
"(",
"TRANSACTION_DELIMITER",
")",
";",
"if",
"(",
"endOfStreamNamePos",
"<",
"0",
"||",... | Get base name of segment with the potential transaction delimiter removed.
@param segmentQualifiedName fully qualified segment name.
@return the base name of segment. | [
"Get",
"base",
"name",
"of",
"segment",
"with",
"the",
"potential",
"transaction",
"delimiter",
"removed",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/metrics/src/main/java/io/pravega/shared/MetricsTags.java#L126-L134 |
132,209 | pravega/pravega | shared/metrics/src/main/java/io/pravega/shared/MetricsTags.java | MetricsTags.createHostTag | public static String[] createHostTag() {
String[] hostTag = {MetricsTags.TAG_HOST, null};
try {
hostTag[1] = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
hostTag[1] = "unknown";
}
return hostTag;
} | java | public static String[] createHostTag() {
String[] hostTag = {MetricsTags.TAG_HOST, null};
try {
hostTag[1] = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
hostTag[1] = "unknown";
}
return hostTag;
} | [
"public",
"static",
"String",
"[",
"]",
"createHostTag",
"(",
")",
"{",
"String",
"[",
"]",
"hostTag",
"=",
"{",
"MetricsTags",
".",
"TAG_HOST",
",",
"null",
"}",
";",
"try",
"{",
"hostTag",
"[",
"1",
"]",
"=",
"InetAddress",
".",
"getLocalHost",
"(",
... | Create host tag based on the local host.
@return host tag. | [
"Create",
"host",
"tag",
"based",
"on",
"the",
"local",
"host",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/metrics/src/main/java/io/pravega/shared/MetricsTags.java#L140-L148 |
132,210 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ContainerReadIndex.java | ContainerReadIndex.append | @Override
public void append(long streamSegmentId, long offset, byte[] data) throws StreamSegmentNotExistsException {
Exceptions.checkNotClosed(this.closed.get(), this);
log.debug("{}: append (StreamSegmentId = {}, Offset = {}, DataLength = {}).", this.traceObjectId, streamSegmentId, offset, data.le... | java | @Override
public void append(long streamSegmentId, long offset, byte[] data) throws StreamSegmentNotExistsException {
Exceptions.checkNotClosed(this.closed.get(), this);
log.debug("{}: append (StreamSegmentId = {}, Offset = {}, DataLength = {}).", this.traceObjectId, streamSegmentId, offset, data.le... | [
"@",
"Override",
"public",
"void",
"append",
"(",
"long",
"streamSegmentId",
",",
"long",
"offset",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"StreamSegmentNotExistsException",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
".",
"get... | region ReadIndex Implementation | [
"region",
"ReadIndex",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ContainerReadIndex.java#L122-L131 |
132,211 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ContainerReadIndex.java | ContainerReadIndex.getOrCreateIndex | private StreamSegmentReadIndex getOrCreateIndex(long streamSegmentId) throws StreamSegmentNotExistsException {
StreamSegmentReadIndex index;
synchronized (this.lock) {
// Try to see if we have the index already in memory.
index = getIndex(streamSegmentId);
if (index =... | java | private StreamSegmentReadIndex getOrCreateIndex(long streamSegmentId) throws StreamSegmentNotExistsException {
StreamSegmentReadIndex index;
synchronized (this.lock) {
// Try to see if we have the index already in memory.
index = getIndex(streamSegmentId);
if (index =... | [
"private",
"StreamSegmentReadIndex",
"getOrCreateIndex",
"(",
"long",
"streamSegmentId",
")",
"throws",
"StreamSegmentNotExistsException",
"{",
"StreamSegmentReadIndex",
"index",
";",
"synchronized",
"(",
"this",
".",
"lock",
")",
"{",
"// Try to see if we have the index alre... | Gets a reference to the existing StreamSegmentRead index for the given StreamSegment Id. Creates a new one if
necessary.
@param streamSegmentId The Id of the StreamSegment whose ReadIndex to get. | [
"Gets",
"a",
"reference",
"to",
"the",
"existing",
"StreamSegmentRead",
"index",
"for",
"the",
"given",
"StreamSegment",
"Id",
".",
"Creates",
"a",
"new",
"one",
"if",
"necessary",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ContainerReadIndex.java#L356-L377 |
132,212 | pravega/pravega | common/src/main/java/io/pravega/common/SimpleMovingAverage.java | SimpleMovingAverage.add | public void add(int value) {
int newIndex = (this.lastIndex + 1) % this.samples.length;
if (this.count >= this.samples.length) {
// We are going to overwrite a value, so subtract it from the grand sum.
this.sum -= this.samples[newIndex];
} else {
this.count++;... | java | public void add(int value) {
int newIndex = (this.lastIndex + 1) % this.samples.length;
if (this.count >= this.samples.length) {
// We are going to overwrite a value, so subtract it from the grand sum.
this.sum -= this.samples[newIndex];
} else {
this.count++;... | [
"public",
"void",
"add",
"(",
"int",
"value",
")",
"{",
"int",
"newIndex",
"=",
"(",
"this",
".",
"lastIndex",
"+",
"1",
")",
"%",
"this",
".",
"samples",
".",
"length",
";",
"if",
"(",
"this",
".",
"count",
">=",
"this",
".",
"samples",
".",
"le... | Adds the given value to the moving average. If the moving average is already at capacity, this will overwrite
the oldest value in the series.
@param value The value to add. | [
"Adds",
"the",
"given",
"value",
"to",
"the",
"moving",
"average",
".",
"If",
"the",
"moving",
"average",
"is",
"already",
"at",
"capacity",
"this",
"will",
"overwrite",
"the",
"oldest",
"value",
"in",
"the",
"series",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/SimpleMovingAverage.java#L43-L56 |
132,213 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StorageReadManager.java | StorageReadManager.executeStorageRead | private void executeStorageRead(Request request) {
try {
byte[] buffer = new byte[request.length];
getHandle()
.thenComposeAsync(handle -> this.storage.read(handle, request.offset, buffer, 0, buffer.length, request.getTimeout()), this.executor)
.th... | java | private void executeStorageRead(Request request) {
try {
byte[] buffer = new byte[request.length];
getHandle()
.thenComposeAsync(handle -> this.storage.read(handle, request.offset, buffer, 0, buffer.length, request.getTimeout()), this.executor)
.th... | [
"private",
"void",
"executeStorageRead",
"(",
"Request",
"request",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"request",
".",
"length",
"]",
";",
"getHandle",
"(",
")",
".",
"thenComposeAsync",
"(",
"handle",
"->",
"this"... | Executes the Storage Read for the given request.
@param request The request. | [
"Executes",
"the",
"Storage",
"Read",
"for",
"the",
"given",
"request",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StorageReadManager.java#L132-L154 |
132,214 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StorageReadManager.java | StorageReadManager.findOverlappingRequest | @GuardedBy("lock")
private Request findOverlappingRequest(Request request) {
Map.Entry<Long, Request> previousEntry = this.pendingRequests.floorEntry(request.getOffset());
if (previousEntry != null && request.getOffset() < previousEntry.getValue().getEndOffset()) {
// Found one.
... | java | @GuardedBy("lock")
private Request findOverlappingRequest(Request request) {
Map.Entry<Long, Request> previousEntry = this.pendingRequests.floorEntry(request.getOffset());
if (previousEntry != null && request.getOffset() < previousEntry.getValue().getEndOffset()) {
// Found one.
... | [
"@",
"GuardedBy",
"(",
"\"lock\"",
")",
"private",
"Request",
"findOverlappingRequest",
"(",
"Request",
"request",
")",
"{",
"Map",
".",
"Entry",
"<",
"Long",
",",
"Request",
">",
"previousEntry",
"=",
"this",
".",
"pendingRequests",
".",
"floorEntry",
"(",
... | Finds a pending Request that overlaps with the given request, based on the given request's Offset.
@param request The request.
@return The overlapping request, or null if no such request exists. | [
"Finds",
"a",
"pending",
"Request",
"that",
"overlaps",
"with",
"the",
"given",
"request",
"based",
"on",
"the",
"given",
"request",
"s",
"Offset",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StorageReadManager.java#L182-L192 |
132,215 | pravega/pravega | common/src/main/java/io/pravega/common/io/serialization/VersionedSerializer.java | VersionedSerializer.serialize | public void serialize(RevisionDataOutput dataOutput, T object) throws IOException {
serialize(dataOutput.getBaseStream(), object);
} | java | public void serialize(RevisionDataOutput dataOutput, T object) throws IOException {
serialize(dataOutput.getBaseStream(), object);
} | [
"public",
"void",
"serialize",
"(",
"RevisionDataOutput",
"dataOutput",
",",
"T",
"object",
")",
"throws",
"IOException",
"{",
"serialize",
"(",
"dataOutput",
".",
"getBaseStream",
"(",
")",
",",
"object",
")",
";",
"}"
] | Serializes the given object to the given RevisionDataOutput. This overload is usually invoked for serializing
nested classes or collections.
@param dataOutput The RevisionDataOutput to serialize to.
@param object The object to serialize.
@throws IOException If an IO Exception occurred. | [
"Serializes",
"the",
"given",
"object",
"to",
"the",
"given",
"RevisionDataOutput",
".",
"This",
"overload",
"is",
"usually",
"invoked",
"for",
"serializing",
"nested",
"classes",
"or",
"collections",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/serialization/VersionedSerializer.java#L115-L117 |
132,216 | pravega/pravega | common/src/main/java/io/pravega/common/io/serialization/VersionedSerializer.java | VersionedSerializer.processHeader | void processHeader(InputStream dataInput) throws IOException {
int formatVersion = dataInput.read();
if (formatVersion < 0) {
throw new EOFException();
}
ensureCondition(formatVersion == SERIALIZER_VERSION, "Unsupported format version %d.", formatVersion);
} | java | void processHeader(InputStream dataInput) throws IOException {
int formatVersion = dataInput.read();
if (formatVersion < 0) {
throw new EOFException();
}
ensureCondition(formatVersion == SERIALIZER_VERSION, "Unsupported format version %d.", formatVersion);
} | [
"void",
"processHeader",
"(",
"InputStream",
"dataInput",
")",
"throws",
"IOException",
"{",
"int",
"formatVersion",
"=",
"dataInput",
".",
"read",
"(",
")",
";",
"if",
"(",
"formatVersion",
"<",
"0",
")",
"{",
"throw",
"new",
"EOFException",
"(",
")",
";"... | Reads a single unsigned byte from the given InputStream and interprets it as a Serializer Format Version, after
which it validates that it is supported.
@param dataInput The InputStream to read from.
@throws IOException If an IO Exception occurred. | [
"Reads",
"a",
"single",
"unsigned",
"byte",
"from",
"the",
"given",
"InputStream",
"and",
"interprets",
"it",
"as",
"a",
"Serializer",
"Format",
"Version",
"after",
"which",
"it",
"validates",
"that",
"it",
"is",
"supported",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/serialization/VersionedSerializer.java#L149-L155 |
132,217 | pravega/pravega | common/src/main/java/io/pravega/common/io/serialization/VersionedSerializer.java | VersionedSerializer.ensureCondition | void ensureCondition(boolean condition, String messageFormat, Object... args) throws SerializationException {
if (!condition) {
throw new SerializationException(String.format(messageFormat, args));
}
} | java | void ensureCondition(boolean condition, String messageFormat, Object... args) throws SerializationException {
if (!condition) {
throw new SerializationException(String.format(messageFormat, args));
}
} | [
"void",
"ensureCondition",
"(",
"boolean",
"condition",
",",
"String",
"messageFormat",
",",
"Object",
"...",
"args",
")",
"throws",
"SerializationException",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"SerializationException",
"(",
"String",
".... | Verifies that the given condition is true. If not, throws a SerializationException. | [
"Verifies",
"that",
"the",
"given",
"condition",
"is",
"true",
".",
"If",
"not",
"throws",
"a",
"SerializationException",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/serialization/VersionedSerializer.java#L160-L164 |
132,218 | pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/StreamSegments.java | StreamSegments.removeDuplicates | private void removeDuplicates(NavigableMap<Double, SegmentWithRange> result) {
Segment last = null;
for (Iterator<SegmentWithRange> iterator = result.descendingMap().values().iterator(); iterator.hasNext();) {
SegmentWithRange current = iterator.next();
if (current.getSegment().e... | java | private void removeDuplicates(NavigableMap<Double, SegmentWithRange> result) {
Segment last = null;
for (Iterator<SegmentWithRange> iterator = result.descendingMap().values().iterator(); iterator.hasNext();) {
SegmentWithRange current = iterator.next();
if (current.getSegment().e... | [
"private",
"void",
"removeDuplicates",
"(",
"NavigableMap",
"<",
"Double",
",",
"SegmentWithRange",
">",
"result",
")",
"{",
"Segment",
"last",
"=",
"null",
";",
"for",
"(",
"Iterator",
"<",
"SegmentWithRange",
">",
"iterator",
"=",
"result",
".",
"descendingM... | This combines consecutive entries in the map that refer to the same segment.
This happens following a merge because the preceeding segments are replaced one at a time. | [
"This",
"combines",
"consecutive",
"entries",
"in",
"the",
"map",
"that",
"refer",
"to",
"the",
"same",
"segment",
".",
"This",
"happens",
"following",
"a",
"merge",
"because",
"the",
"preceeding",
"segments",
"are",
"replaced",
"one",
"at",
"a",
"time",
"."... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/StreamSegments.java#L121-L130 |
132,219 | pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/StreamSegments.java | StreamSegments.verifyReplacementRange | private void verifyReplacementRange(SegmentWithRange replacedSegment, StreamSegmentsWithPredecessors replacementSegments) {
log.debug("Verification of replacement segments {} with the current segments {}", replacementSegments, segments);
Map<Long, List<SegmentWithRange>> replacementRanges = replacementS... | java | private void verifyReplacementRange(SegmentWithRange replacedSegment, StreamSegmentsWithPredecessors replacementSegments) {
log.debug("Verification of replacement segments {} with the current segments {}", replacementSegments, segments);
Map<Long, List<SegmentWithRange>> replacementRanges = replacementS... | [
"private",
"void",
"verifyReplacementRange",
"(",
"SegmentWithRange",
"replacedSegment",
",",
"StreamSegmentsWithPredecessors",
"replacementSegments",
")",
"{",
"log",
".",
"debug",
"(",
"\"Verification of replacement segments {} with the current segments {}\"",
",",
"replacementSe... | Checks that replacementSegments provided are consistent with the segments that are currently being used.
@param replacedSegment The segment on which EOS was reached
@param replacementSegments The StreamSegmentsWithPredecessors to verify | [
"Checks",
"that",
"replacementSegments",
"provided",
"are",
"consistent",
"with",
"the",
"segments",
"that",
"are",
"currently",
"being",
"used",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/StreamSegments.java#L145-L166 |
132,220 | pravega/pravega | segmentstore/contracts/src/main/java/io/pravega/segmentstore/contracts/Attributes.java | Attributes.getCoreNonNullAttributes | public static Map<UUID, Long> getCoreNonNullAttributes(Map<UUID, Long> attributes) {
return attributes.entrySet().stream()
.filter(e -> Attributes.isCoreAttribute(e.getKey()) && e.getValue() != NULL_ATTRIBUTE_VALUE)
.collect(Collectors.toMap(Map.Entry::getKey, M... | java | public static Map<UUID, Long> getCoreNonNullAttributes(Map<UUID, Long> attributes) {
return attributes.entrySet().stream()
.filter(e -> Attributes.isCoreAttribute(e.getKey()) && e.getValue() != NULL_ATTRIBUTE_VALUE)
.collect(Collectors.toMap(Map.Entry::getKey, M... | [
"public",
"static",
"Map",
"<",
"UUID",
",",
"Long",
">",
"getCoreNonNullAttributes",
"(",
"Map",
"<",
"UUID",
",",
"Long",
">",
"attributes",
")",
"{",
"return",
"attributes",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"e"... | Returns a new Map of Attribute Ids to Values containing only those Core Attributes from the given Map that do not
have a null value.
@param attributes The Map of Attribute Ids to Values to filter from.
@return A new Map containing only Core Attribute Ids and Values (from the original map). | [
"Returns",
"a",
"new",
"Map",
"of",
"Attribute",
"Ids",
"to",
"Values",
"containing",
"only",
"those",
"Core",
"Attributes",
"from",
"the",
"given",
"Map",
"that",
"do",
"not",
"have",
"a",
"null",
"value",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/contracts/src/main/java/io/pravega/segmentstore/contracts/Attributes.java#L97-L101 |
132,221 | pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java | SegmentChunk.forSegment | static SegmentChunk forSegment(String segmentName, long startOffset) {
return new SegmentChunk(StreamSegmentNameUtils.getSegmentChunkName(segmentName, startOffset), startOffset);
} | java | static SegmentChunk forSegment(String segmentName, long startOffset) {
return new SegmentChunk(StreamSegmentNameUtils.getSegmentChunkName(segmentName, startOffset), startOffset);
} | [
"static",
"SegmentChunk",
"forSegment",
"(",
"String",
"segmentName",
",",
"long",
"startOffset",
")",
"{",
"return",
"new",
"SegmentChunk",
"(",
"StreamSegmentNameUtils",
".",
"getSegmentChunkName",
"(",
"segmentName",
",",
"startOffset",
")",
",",
"startOffset",
"... | Creates a new instance of the SegmentChunk class.
@param segmentName The name of the owning Segment (not the name of this SegmentChunk).
@param startOffset The offset within the owning Segment where this SegmentChunk starts at.
@return A new SegmentChunk. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"SegmentChunk",
"class",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java#L66-L68 |
132,222 | pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java | SegmentChunk.withNewOffset | SegmentChunk withNewOffset(long newOffset) {
SegmentChunk ns = new SegmentChunk(this.name, newOffset);
ns.setLength(getLength());
if (isSealed()) {
ns.markSealed();
}
if (!exists()) {
ns.markInexistent();
}
return ns;
} | java | SegmentChunk withNewOffset(long newOffset) {
SegmentChunk ns = new SegmentChunk(this.name, newOffset);
ns.setLength(getLength());
if (isSealed()) {
ns.markSealed();
}
if (!exists()) {
ns.markInexistent();
}
return ns;
} | [
"SegmentChunk",
"withNewOffset",
"(",
"long",
"newOffset",
")",
"{",
"SegmentChunk",
"ns",
"=",
"new",
"SegmentChunk",
"(",
"this",
".",
"name",
",",
"newOffset",
")",
";",
"ns",
".",
"setLength",
"(",
"getLength",
"(",
")",
")",
";",
"if",
"(",
"isSeale... | Creates a new instance of the SegmentChunk class with the same information as this one, but with a new offset.
@param newOffset The new offset.
@return A new SegmentChunk. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"SegmentChunk",
"class",
"with",
"the",
"same",
"information",
"as",
"this",
"one",
"but",
"with",
"a",
"new",
"offset",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java#L76-L88 |
132,223 | pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java | SegmentChunk.increaseLength | synchronized void increaseLength(long delta) {
Preconditions.checkState(!this.sealed, "Cannot increase the length of a sealed SegmentChunk.");
Preconditions.checkArgument(delta >= 0, "Cannot decrease the length of a SegmentChunk.");
this.length += delta;
} | java | synchronized void increaseLength(long delta) {
Preconditions.checkState(!this.sealed, "Cannot increase the length of a sealed SegmentChunk.");
Preconditions.checkArgument(delta >= 0, "Cannot decrease the length of a SegmentChunk.");
this.length += delta;
} | [
"synchronized",
"void",
"increaseLength",
"(",
"long",
"delta",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"this",
".",
"sealed",
",",
"\"Cannot increase the length of a sealed SegmentChunk.\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"delta... | Increases the length of the SegmentChunk by the given delta.
@param delta The value to increase by. | [
"Increases",
"the",
"length",
"of",
"the",
"SegmentChunk",
"by",
"the",
"given",
"delta",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java#L140-L144 |
132,224 | pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java | SegmentChunk.setLength | synchronized void setLength(long length) {
Preconditions.checkState(!this.sealed, "Cannot increase the length of a sealed SegmentChunk.");
Preconditions.checkArgument(length >= 0, "length must be a non-negative number.");
this.length = length;
} | java | synchronized void setLength(long length) {
Preconditions.checkState(!this.sealed, "Cannot increase the length of a sealed SegmentChunk.");
Preconditions.checkArgument(length >= 0, "length must be a non-negative number.");
this.length = length;
} | [
"synchronized",
"void",
"setLength",
"(",
"long",
"length",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"this",
".",
"sealed",
",",
"\"Cannot increase the length of a sealed SegmentChunk.\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"length",
... | Sets the length of the SegmentChunk.
@param length The new length. | [
"Sets",
"the",
"length",
"of",
"the",
"SegmentChunk",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/SegmentChunk.java#L150-L154 |
132,225 | pravega/pravega | shared/cluster/src/main/java/io/pravega/common/cluster/zkImpl/ClusterZKImpl.java | ClusterZKImpl.registerHost | @Override
@Synchronized
public void registerHost(Host host) {
Preconditions.checkNotNull(host, "host");
Exceptions.checkArgument(!entryMap.containsKey(host), "host", "host is already registered to cluster.");
String hostPath = ZKPaths.makePath(getPathPrefix(), host.toString());
... | java | @Override
@Synchronized
public void registerHost(Host host) {
Preconditions.checkNotNull(host, "host");
Exceptions.checkArgument(!entryMap.containsKey(host), "host", "host is already registered to cluster.");
String hostPath = ZKPaths.makePath(getPathPrefix(), host.toString());
... | [
"@",
"Override",
"@",
"Synchronized",
"public",
"void",
"registerHost",
"(",
"Host",
"host",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"host",
",",
"\"host\"",
")",
";",
"Exceptions",
".",
"checkArgument",
"(",
"!",
"entryMap",
".",
"containsKey",
... | Register Host to cluster.
@param host Host to be part of cluster. | [
"Register",
"Host",
"to",
"cluster",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/cluster/src/main/java/io/pravega/common/cluster/zkImpl/ClusterZKImpl.java#L77-L89 |
132,226 | pravega/pravega | shared/cluster/src/main/java/io/pravega/common/cluster/zkImpl/ClusterZKImpl.java | ClusterZKImpl.deregisterHost | @Override
@Synchronized
public void deregisterHost(Host host) {
Preconditions.checkNotNull(host, "host");
PersistentNode node = entryMap.get(host);
Preconditions.checkNotNull(node, "Host is not present in cluster.");
entryMap.remove(host);
close(node);
} | java | @Override
@Synchronized
public void deregisterHost(Host host) {
Preconditions.checkNotNull(host, "host");
PersistentNode node = entryMap.get(host);
Preconditions.checkNotNull(node, "Host is not present in cluster.");
entryMap.remove(host);
close(node);
} | [
"@",
"Override",
"@",
"Synchronized",
"public",
"void",
"deregisterHost",
"(",
"Host",
"host",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"host",
",",
"\"host\"",
")",
";",
"PersistentNode",
"node",
"=",
"entryMap",
".",
"get",
"(",
"host",
")",
... | Remove Host from cluster.
@param host Host to be removed from cluster. | [
"Remove",
"Host",
"from",
"cluster",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/cluster/src/main/java/io/pravega/common/cluster/zkImpl/ClusterZKImpl.java#L96-L104 |
132,227 | pravega/pravega | shared/cluster/src/main/java/io/pravega/common/cluster/zkImpl/ClusterZKImpl.java | ClusterZKImpl.addListener | @Override
@Synchronized
public void addListener(ClusterListener listener) {
Preconditions.checkNotNull(listener, "listener");
if (!cache.isPresent()) {
initializeCache();
}
cache.get().getListenable().addListener(pathChildrenCacheListener(listener));
} | java | @Override
@Synchronized
public void addListener(ClusterListener listener) {
Preconditions.checkNotNull(listener, "listener");
if (!cache.isPresent()) {
initializeCache();
}
cache.get().getListenable().addListener(pathChildrenCacheListener(listener));
} | [
"@",
"Override",
"@",
"Synchronized",
"public",
"void",
"addListener",
"(",
"ClusterListener",
"listener",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"listener",
",",
"\"listener\"",
")",
";",
"if",
"(",
"!",
"cache",
".",
"isPresent",
"(",
")",
")... | Add Listener to the cluster.
@param listener Cluster event Listener. | [
"Add",
"Listener",
"to",
"the",
"cluster",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/cluster/src/main/java/io/pravega/common/cluster/zkImpl/ClusterZKImpl.java#L111-L119 |
132,228 | pravega/pravega | shared/cluster/src/main/java/io/pravega/common/cluster/zkImpl/ClusterZKImpl.java | ClusterZKImpl.getClusterMembers | @Override
@Synchronized
public Set<Host> getClusterMembers() {
if (!cache.isPresent()) {
initializeCache();
}
List<ChildData> data = cache.get().getCurrentData();
return data.stream()
.map(d -> Host.fromBytes(d.getData()))
.collect(Coll... | java | @Override
@Synchronized
public Set<Host> getClusterMembers() {
if (!cache.isPresent()) {
initializeCache();
}
List<ChildData> data = cache.get().getCurrentData();
return data.stream()
.map(d -> Host.fromBytes(d.getData()))
.collect(Coll... | [
"@",
"Override",
"@",
"Synchronized",
"public",
"Set",
"<",
"Host",
">",
"getClusterMembers",
"(",
")",
"{",
"if",
"(",
"!",
"cache",
".",
"isPresent",
"(",
")",
")",
"{",
"initializeCache",
"(",
")",
";",
"}",
"List",
"<",
"ChildData",
">",
"data",
... | Get the current cluster members.
@return List of cluster members. | [
"Get",
"the",
"current",
"cluster",
"members",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/cluster/src/main/java/io/pravega/common/cluster/zkImpl/ClusterZKImpl.java#L143-L153 |
132,229 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.validateInputRange | public static boolean validateInputRange(final List<Long> segmentsToSeal,
final List<Map.Entry<Double, Double>> newRanges,
final EpochRecord currentEpoch) {
boolean newRangesCheck = newRanges.stream().noneMatch(x -> x.getK... | java | public static boolean validateInputRange(final List<Long> segmentsToSeal,
final List<Map.Entry<Double, Double>> newRanges,
final EpochRecord currentEpoch) {
boolean newRangesCheck = newRanges.stream().noneMatch(x -> x.getK... | [
"public",
"static",
"boolean",
"validateInputRange",
"(",
"final",
"List",
"<",
"Long",
">",
"segmentsToSeal",
",",
"final",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Double",
">",
">",
"newRanges",
",",
"final",
"EpochRecord",
"currentEpoch",
"... | Method to validate supplied scale input. It performs a check that new ranges are identical to sealed ranges.
@param segmentsToSeal segments to seal
@param newRanges new ranges to create
@param currentEpoch current epoch record
@return true if scale input is valid, false otherwise. | [
"Method",
"to",
"validate",
"supplied",
"scale",
"input",
".",
"It",
"performs",
"a",
"check",
"that",
"new",
"ranges",
"are",
"identical",
"to",
"sealed",
"ranges",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L42-L62 |
132,230 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.canScaleFor | public static boolean canScaleFor(final List<Long> segmentsToSeal, final EpochRecord currentEpoch) {
return segmentsToSeal.stream().allMatch(x -> currentEpoch.getSegment(x) != null);
} | java | public static boolean canScaleFor(final List<Long> segmentsToSeal, final EpochRecord currentEpoch) {
return segmentsToSeal.stream().allMatch(x -> currentEpoch.getSegment(x) != null);
} | [
"public",
"static",
"boolean",
"canScaleFor",
"(",
"final",
"List",
"<",
"Long",
">",
"segmentsToSeal",
",",
"final",
"EpochRecord",
"currentEpoch",
")",
"{",
"return",
"segmentsToSeal",
".",
"stream",
"(",
")",
".",
"allMatch",
"(",
"x",
"->",
"currentEpoch",... | Method to check that segments to seal are present in current epoch.
@param segmentsToSeal segments to seal
@param currentEpoch current epoch record
@return true if a scale operation can be performed, false otherwise | [
"Method",
"to",
"check",
"that",
"segments",
"to",
"seal",
"are",
"present",
"in",
"current",
"epoch",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L71-L73 |
132,231 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.verifyRecordMatchesInput | public static boolean verifyRecordMatchesInput(List<Long> segmentsToSeal, List<Map.Entry<Double, Double>> newRanges,
boolean isManualScale, EpochTransitionRecord record) {
// verify that supplied new range matches new range in the record
boolean newRang... | java | public static boolean verifyRecordMatchesInput(List<Long> segmentsToSeal, List<Map.Entry<Double, Double>> newRanges,
boolean isManualScale, EpochTransitionRecord record) {
// verify that supplied new range matches new range in the record
boolean newRang... | [
"public",
"static",
"boolean",
"verifyRecordMatchesInput",
"(",
"List",
"<",
"Long",
">",
"segmentsToSeal",
",",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Double",
">",
">",
"newRanges",
",",
"boolean",
"isManualScale",
",",
"EpochTransitionRecord",... | Method to verify if supplied epoch transition record matches the supplied input which includes segments to seal,
new ranges to create.
For manual scale, it will verify that segments to seal match and epoch transition record share the same segment
number.
@param segmentsToSeal list of segments to seal
@param newRanges ... | [
"Method",
"to",
"verify",
"if",
"supplied",
"epoch",
"transition",
"record",
"matches",
"the",
"supplied",
"input",
"which",
"includes",
"segments",
"to",
"seal",
"new",
"ranges",
"to",
"create",
".",
"For",
"manual",
"scale",
"it",
"will",
"verify",
"that",
... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L87-L110 |
132,232 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.computeEpochTransition | public static EpochTransitionRecord computeEpochTransition(EpochRecord currentEpoch, List<Long> segmentsToSeal,
List<Map.Entry<Double, Double>> newRanges, long scaleTimestamp) {
Preconditions.checkState(segmentsToSeal.stream().allMatch(currentEpoch:... | java | public static EpochTransitionRecord computeEpochTransition(EpochRecord currentEpoch, List<Long> segmentsToSeal,
List<Map.Entry<Double, Double>> newRanges, long scaleTimestamp) {
Preconditions.checkState(segmentsToSeal.stream().allMatch(currentEpoch:... | [
"public",
"static",
"EpochTransitionRecord",
"computeEpochTransition",
"(",
"EpochRecord",
"currentEpoch",
",",
"List",
"<",
"Long",
">",
"segmentsToSeal",
",",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Double",
">",
">",
"newRanges",
",",
"long",
... | Method to compute epoch transition record. It takes segments to seal and new ranges and all the tables and
computes the next epoch transition record.
@param currentEpoch current epoch record
@param segmentsToSeal segments to seal
@param newRanges new ranges
@param scaleTimestamp scale time
@return new epoch transition ... | [
"Method",
"to",
"compute",
"epoch",
"transition",
"record",
".",
"It",
"takes",
"segments",
"to",
"seal",
"and",
"new",
"ranges",
"and",
"all",
"the",
"tables",
"and",
"computes",
"the",
"next",
"epoch",
"transition",
"record",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L121-L134 |
132,233 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.generateTxnId | public static UUID generateTxnId(int epoch, int msb, long lsb) {
long msb64Bit = (long) epoch << 32 | msb & 0xFFFFFFFFL;
return new UUID(msb64Bit, lsb);
} | java | public static UUID generateTxnId(int epoch, int msb, long lsb) {
long msb64Bit = (long) epoch << 32 | msb & 0xFFFFFFFFL;
return new UUID(msb64Bit, lsb);
} | [
"public",
"static",
"UUID",
"generateTxnId",
"(",
"int",
"epoch",
",",
"int",
"msb",
",",
"long",
"lsb",
")",
"{",
"long",
"msb64Bit",
"=",
"(",
"long",
")",
"epoch",
"<<",
"32",
"|",
"msb",
"&",
"0xFFFFFFFF",
"L",
";",
"return",
"new",
"UUID",
"(",
... | region transaction id | [
"region",
"transaction",
"id"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L138-L141 |
132,234 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.streamCutComparator | public static boolean streamCutComparator(Map<Long, Long> streamCut1, Map<StreamSegmentRecord, Integer> span1,
Map<Long, Long> streamCut2, Map<StreamSegmentRecord, Integer> span2) {
// find overlapping segments in map2 for all segments in map1
// compare epo... | java | public static boolean streamCutComparator(Map<Long, Long> streamCut1, Map<StreamSegmentRecord, Integer> span1,
Map<Long, Long> streamCut2, Map<StreamSegmentRecord, Integer> span2) {
// find overlapping segments in map2 for all segments in map1
// compare epo... | [
"public",
"static",
"boolean",
"streamCutComparator",
"(",
"Map",
"<",
"Long",
",",
"Long",
">",
"streamCut1",
",",
"Map",
"<",
"StreamSegmentRecord",
",",
"Integer",
">",
"span1",
",",
"Map",
"<",
"Long",
",",
"Long",
">",
"streamCut2",
",",
"Map",
"<",
... | Method to compare two stream cuts given their spans.
@param streamCut1 stream cut 1
@param span1 snap for stream cut 1
@param streamCut2 stream cut 2
@param span2 span for stream cut 2
@return returns true if streamcut 1 is strictly ahead of streamcut 2, false otherwise. | [
"Method",
"to",
"compare",
"two",
"stream",
"cuts",
"given",
"their",
"spans",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L191-L200 |
132,235 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.reduce | private static List<Map.Entry<Double, Double>> reduce(List<Map.Entry<Double, Double>> input) {
List<Map.Entry<Double, Double>> ranges = new ArrayList<>(input);
ranges.sort(Comparator.comparingDouble(Map.Entry::getKey));
List<Map.Entry<Double, Double>> result = new ArrayList<>();
double l... | java | private static List<Map.Entry<Double, Double>> reduce(List<Map.Entry<Double, Double>> input) {
List<Map.Entry<Double, Double>> ranges = new ArrayList<>(input);
ranges.sort(Comparator.comparingDouble(Map.Entry::getKey));
List<Map.Entry<Double, Double>> result = new ArrayList<>();
double l... | [
"private",
"static",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Double",
">",
">",
"reduce",
"(",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Double",
">",
">",
"input",
")",
"{",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Dou... | Helper method to compute list of continuous ranges. For example, two neighbouring key ranges where,
range1.high == range2.low then they are considered neighbours.
This method reduces input range into distinct continuous blocks.
@param input list of key ranges.
@return reduced list of key ranges. | [
"Helper",
"method",
"to",
"compute",
"list",
"of",
"continuous",
"ranges",
".",
"For",
"example",
"two",
"neighbouring",
"key",
"ranges",
"where",
"range1",
".",
"high",
"==",
"range2",
".",
"low",
"then",
"they",
"are",
"considered",
"neighbours",
".",
"Thi... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L210-L242 |
132,236 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainerMetadata.java | StreamSegmentContainerMetadata.getStreamSegmentId | @Override
public long getStreamSegmentId(String streamSegmentName, boolean updateLastUsed) {
synchronized (this.lock) {
StreamSegmentMetadata metadata = this.metadataByName.getOrDefault(streamSegmentName, null);
if (updateLastUsed && metadata != null) {
metadata.setLa... | java | @Override
public long getStreamSegmentId(String streamSegmentName, boolean updateLastUsed) {
synchronized (this.lock) {
StreamSegmentMetadata metadata = this.metadataByName.getOrDefault(streamSegmentName, null);
if (updateLastUsed && metadata != null) {
metadata.setLa... | [
"@",
"Override",
"public",
"long",
"getStreamSegmentId",
"(",
"String",
"streamSegmentName",
",",
"boolean",
"updateLastUsed",
")",
"{",
"synchronized",
"(",
"this",
".",
"lock",
")",
"{",
"StreamSegmentMetadata",
"metadata",
"=",
"this",
".",
"metadataByName",
".... | region SegmentMetadataCollection Implementation | [
"region",
"SegmentMetadataCollection",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainerMetadata.java#L98-L108 |
132,237 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainerMetadata.java | StreamSegmentContainerMetadata.getEvictionCandidates | @Override
public Collection<SegmentMetadata> getEvictionCandidates(long sequenceNumberCutoff, int maxCount) {
long adjustedCutoff = Math.min(sequenceNumberCutoff, this.lastTruncatedSequenceNumber.get());
List<SegmentMetadata> candidates;
synchronized (this.lock) {
candidates = th... | java | @Override
public Collection<SegmentMetadata> getEvictionCandidates(long sequenceNumberCutoff, int maxCount) {
long adjustedCutoff = Math.min(sequenceNumberCutoff, this.lastTruncatedSequenceNumber.get());
List<SegmentMetadata> candidates;
synchronized (this.lock) {
candidates = th... | [
"@",
"Override",
"public",
"Collection",
"<",
"SegmentMetadata",
">",
"getEvictionCandidates",
"(",
"long",
"sequenceNumberCutoff",
",",
"int",
"maxCount",
")",
"{",
"long",
"adjustedCutoff",
"=",
"Math",
".",
"min",
"(",
"sequenceNumberCutoff",
",",
"this",
".",
... | region EvictableMetadata Implementation | [
"region",
"EvictableMetadata",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainerMetadata.java#L221-L239 |
132,238 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainerMetadata.java | StreamSegmentContainerMetadata.recordTruncationMarker | @Override
public void recordTruncationMarker(long operationSequenceNumber, LogAddress address) {
Exceptions.checkArgument(operationSequenceNumber >= 0, "operationSequenceNumber",
"Operation Sequence Number must be a positive number.");
Preconditions.checkNotNull(address, "address");
... | java | @Override
public void recordTruncationMarker(long operationSequenceNumber, LogAddress address) {
Exceptions.checkArgument(operationSequenceNumber >= 0, "operationSequenceNumber",
"Operation Sequence Number must be a positive number.");
Preconditions.checkNotNull(address, "address");
... | [
"@",
"Override",
"public",
"void",
"recordTruncationMarker",
"(",
"long",
"operationSequenceNumber",
",",
"LogAddress",
"address",
")",
"{",
"Exceptions",
".",
"checkArgument",
"(",
"operationSequenceNumber",
">=",
"0",
",",
"\"operationSequenceNumber\"",
",",
"\"Operat... | region TruncationMarkerRepository Implementation | [
"region",
"TruncationMarkerRepository",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainerMetadata.java#L352-L363 |
132,239 | pravega/pravega | common/src/main/java/io/pravega/common/io/BoundedInputStream.java | BoundedInputStream.close | @Override
public void close() throws IOException {
// Skip over the remaining bytes. Do not close the underlying InputStream.
if (this.remaining > 0) {
int toSkip = this.remaining;
long skipped = skip(toSkip);
if (skipped != toSkip) {
throw new Ser... | java | @Override
public void close() throws IOException {
// Skip over the remaining bytes. Do not close the underlying InputStream.
if (this.remaining > 0) {
int toSkip = this.remaining;
long skipped = skip(toSkip);
if (skipped != toSkip) {
throw new Ser... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"// Skip over the remaining bytes. Do not close the underlying InputStream.",
"if",
"(",
"this",
".",
"remaining",
">",
"0",
")",
"{",
"int",
"toSkip",
"=",
"this",
".",
"remaining",... | region InputStream Implementation | [
"region",
"InputStream",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/BoundedInputStream.java#L52-L64 |
132,240 | pravega/pravega | common/src/main/java/io/pravega/common/io/BoundedInputStream.java | BoundedInputStream.subStream | public BoundedInputStream subStream(int bound) {
Preconditions.checkArgument(bound >= 0 && bound <= this.remaining,
"bound must be a non-negative integer and less than or equal to the remaining length.");
this.remaining -= bound;
return new BoundedInputStream(this.in, bound);
... | java | public BoundedInputStream subStream(int bound) {
Preconditions.checkArgument(bound >= 0 && bound <= this.remaining,
"bound must be a non-negative integer and less than or equal to the remaining length.");
this.remaining -= bound;
return new BoundedInputStream(this.in, bound);
... | [
"public",
"BoundedInputStream",
"subStream",
"(",
"int",
"bound",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"bound",
">=",
"0",
"&&",
"bound",
"<=",
"this",
".",
"remaining",
",",
"\"bound must be a non-negative integer and less than or equal to the remaining ... | Creates a new BoundedInputStream wrapping the same InputStream as this one, starting at the current position, with
the given bound.
NOTE: both this instance and the result of this method should not be both used at the same time to read from the
InputStream. When this method returns, this instance's remaining count wil... | [
"Creates",
"a",
"new",
"BoundedInputStream",
"wrapping",
"the",
"same",
"InputStream",
"as",
"this",
"one",
"starting",
"at",
"the",
"current",
"position",
"with",
"the",
"given",
"bound",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/BoundedInputStream.java#L113-L118 |
132,241 | pravega/pravega | controller/src/main/java/io/pravega/controller/server/rpc/grpc/GRPCServer.java | GRPCServer.startUp | @Override
protected void startUp() throws Exception {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.objectId, "startUp");
try {
log.info("Starting gRPC server listening on port: {}", this.config.getPort());
this.server.start();
} finally {
L... | java | @Override
protected void startUp() throws Exception {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.objectId, "startUp");
try {
log.info("Starting gRPC server listening on port: {}", this.config.getPort());
this.server.start();
} finally {
L... | [
"@",
"Override",
"protected",
"void",
"startUp",
"(",
")",
"throws",
"Exception",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"objectId",
",",
"\"startUp\"",
")",
";",
"try",
"{",
"log",
".",
"i... | Start gRPC server. | [
"Start",
"gRPC",
"server",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rpc/grpc/GRPCServer.java#L73-L82 |
132,242 | pravega/pravega | controller/src/main/java/io/pravega/controller/server/rpc/grpc/GRPCServer.java | GRPCServer.shutDown | @Override
protected void shutDown() throws Exception {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.objectId, "shutDown");
try {
log.info("Stopping gRPC server listening on port: {}", this.config.getPort());
this.server.shutdown();
log.info("Awaiti... | java | @Override
protected void shutDown() throws Exception {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.objectId, "shutDown");
try {
log.info("Stopping gRPC server listening on port: {}", this.config.getPort());
this.server.shutdown();
log.info("Awaiti... | [
"@",
"Override",
"protected",
"void",
"shutDown",
"(",
")",
"throws",
"Exception",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"objectId",
",",
"\"shutDown\"",
")",
";",
"try",
"{",
"log",
".",
... | Gracefully stop gRPC server. | [
"Gracefully",
"stop",
"gRPC",
"server",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rpc/grpc/GRPCServer.java#L87-L99 |
132,243 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.exceedsThresholds | private boolean exceedsThresholds() {
boolean isFirstAppend = this.operations.size() > 0 && isAppendOperation(this.operations.getFirst());
long length = isFirstAppend ? this.operations.getFirst().getLength() : 0;
if (isFirstAppend && length == 0 && !((AggregatedAppendOperation) this.operations.g... | java | private boolean exceedsThresholds() {
boolean isFirstAppend = this.operations.size() > 0 && isAppendOperation(this.operations.getFirst());
long length = isFirstAppend ? this.operations.getFirst().getLength() : 0;
if (isFirstAppend && length == 0 && !((AggregatedAppendOperation) this.operations.g... | [
"private",
"boolean",
"exceedsThresholds",
"(",
")",
"{",
"boolean",
"isFirstAppend",
"=",
"this",
".",
"operations",
".",
"size",
"(",
")",
">",
"0",
"&&",
"isAppendOperation",
"(",
"this",
".",
"operations",
".",
"getFirst",
"(",
")",
")",
";",
"long",
... | Gets a value indicating whether the Flush thresholds are exceeded for this SegmentAggregator. | [
"Gets",
"a",
"value",
"indicating",
"whether",
"the",
"Flush",
"thresholds",
"are",
"exceeded",
"for",
"this",
"SegmentAggregator",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L207-L217 |
132,244 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.isReconciling | private boolean isReconciling() {
AggregatorState currentState = this.state.get();
return currentState == AggregatorState.ReconciliationNeeded
|| currentState == AggregatorState.Reconciling;
} | java | private boolean isReconciling() {
AggregatorState currentState = this.state.get();
return currentState == AggregatorState.ReconciliationNeeded
|| currentState == AggregatorState.Reconciling;
} | [
"private",
"boolean",
"isReconciling",
"(",
")",
"{",
"AggregatorState",
"currentState",
"=",
"this",
".",
"state",
".",
"get",
"(",
")",
";",
"return",
"currentState",
"==",
"AggregatorState",
".",
"ReconciliationNeeded",
"||",
"currentState",
"==",
"AggregatorSt... | Gets a value indicating whether the SegmentAggregator is currently in a Reconciliation state. | [
"Gets",
"a",
"value",
"indicating",
"whether",
"the",
"SegmentAggregator",
"is",
"currently",
"in",
"a",
"Reconciliation",
"state",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L222-L226 |
132,245 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.add | @Override
public void add(SegmentOperation operation) throws DataCorruptionException {
ensureInitializedAndNotClosed();
// Verify the operation is valid with respect to the state of this SegmentAggregator.
checkValidOperation(operation);
boolean isDelete = isDeleteOperation(operati... | java | @Override
public void add(SegmentOperation operation) throws DataCorruptionException {
ensureInitializedAndNotClosed();
// Verify the operation is valid with respect to the state of this SegmentAggregator.
checkValidOperation(operation);
boolean isDelete = isDeleteOperation(operati... | [
"@",
"Override",
"public",
"void",
"add",
"(",
"SegmentOperation",
"operation",
")",
"throws",
"DataCorruptionException",
"{",
"ensureInitializedAndNotClosed",
"(",
")",
";",
"// Verify the operation is valid with respect to the state of this SegmentAggregator.",
"checkValidOperati... | Adds the given SegmentOperation to the Aggregator.
@param operation the Operation to add.
@throws DataCorruptionException If the validation of the given Operation indicates a possible data corruption in
the code (offset gaps, out-of-order operations, etc.)
@throws IllegalArgumentException If the validation of the giv... | [
"Adds",
"the",
"given",
"SegmentOperation",
"to",
"the",
"Aggregator",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L331-L356 |
132,246 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.addUpdateAttributesOperation | private void addUpdateAttributesOperation(UpdateAttributesOperation operation) {
if (!this.metadata.isSealedInStorage()) {
// Only process the operation if the Segment is not sealed in Storage. If it is, then so is the Attribute Index,
// and it means this operation has already been appl... | java | private void addUpdateAttributesOperation(UpdateAttributesOperation operation) {
if (!this.metadata.isSealedInStorage()) {
// Only process the operation if the Segment is not sealed in Storage. If it is, then so is the Attribute Index,
// and it means this operation has already been appl... | [
"private",
"void",
"addUpdateAttributesOperation",
"(",
"UpdateAttributesOperation",
"operation",
")",
"{",
"if",
"(",
"!",
"this",
".",
"metadata",
".",
"isSealedInStorage",
"(",
")",
")",
"{",
"// Only process the operation if the Segment is not sealed in Storage. If it is,... | Processes an UpdateAttributesOperation.
@param operation The Operation to process. | [
"Processes",
"an",
"UpdateAttributesOperation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L395-L405 |
132,247 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.processNewOperation | private void processNewOperation(StorageOperation operation) {
if (operation instanceof MergeSegmentOperation) {
this.operations.add(operation);
this.mergeTransactionCount.incrementAndGet();
} else if (operation instanceof StreamSegmentSealOperation) {
this.operations... | java | private void processNewOperation(StorageOperation operation) {
if (operation instanceof MergeSegmentOperation) {
this.operations.add(operation);
this.mergeTransactionCount.incrementAndGet();
} else if (operation instanceof StreamSegmentSealOperation) {
this.operations... | [
"private",
"void",
"processNewOperation",
"(",
"StorageOperation",
"operation",
")",
"{",
"if",
"(",
"operation",
"instanceof",
"MergeSegmentOperation",
")",
"{",
"this",
".",
"operations",
".",
"add",
"(",
"operation",
")",
";",
"this",
".",
"mergeTransactionCoun... | Processes an operation that would result in a change to the underlying Storage.
@param operation The Operation to process. | [
"Processes",
"an",
"operation",
"that",
"would",
"result",
"in",
"a",
"change",
"to",
"the",
"underlying",
"Storage",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L412-L428 |
132,248 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.flush | @Override
public CompletableFuture<WriterFlushResult> flush(Duration timeout) {
ensureInitializedAndNotClosed();
if (this.metadata.isDeletedInStorage()) {
// Segment has been deleted; don't do anything else.
return CompletableFuture.completedFuture(new WriterFlushResult());
... | java | @Override
public CompletableFuture<WriterFlushResult> flush(Duration timeout) {
ensureInitializedAndNotClosed();
if (this.metadata.isDeletedInStorage()) {
// Segment has been deleted; don't do anything else.
return CompletableFuture.completedFuture(new WriterFlushResult());
... | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"flush",
"(",
"Duration",
"timeout",
")",
"{",
"ensureInitializedAndNotClosed",
"(",
")",
";",
"if",
"(",
"this",
".",
"metadata",
".",
"isDeletedInStorage",
"(",
")",
")",
"{",
"//... | Flushes the contents of the Aggregator to the Storage.
@param timeout Timeout for the operation.
@return A CompletableFuture that, when completed, will contain a summary of the flush operation. If any errors
occurred during the flush, the Future will be completed with the appropriate exception. | [
"Flushes",
"the",
"contents",
"of",
"the",
"Aggregator",
"to",
"the",
"Storage",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L538-L577 |
132,249 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.flushNormally | private CompletableFuture<WriterFlushResult> flushNormally(TimeoutTimer timer) {
assert this.state.get() == AggregatorState.Writing : "flushNormally cannot be called if state == " + this.state;
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "flushNormally", this.operations.s... | java | private CompletableFuture<WriterFlushResult> flushNormally(TimeoutTimer timer) {
assert this.state.get() == AggregatorState.Writing : "flushNormally cannot be called if state == " + this.state;
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "flushNormally", this.operations.s... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"flushNormally",
"(",
"TimeoutTimer",
"timer",
")",
"{",
"assert",
"this",
".",
"state",
".",
"get",
"(",
")",
"==",
"AggregatorState",
".",
"Writing",
":",
"\"flushNormally cannot be called if state == \"... | Repeatedly flushes the contents of the Aggregator to the Storage as long as something immediate needs to be flushed,
such as a Seal or Merge operation.
@param timer Timer for the operation.
@return A CompletableFuture that, when completed, will contain the result from the flush operation. | [
"Repeatedly",
"flushes",
"the",
"contents",
"of",
"the",
"Aggregator",
"to",
"the",
"Storage",
"as",
"long",
"as",
"something",
"immediate",
"needs",
"to",
"be",
"flushed",
"such",
"as",
"a",
"Seal",
"or",
"Merge",
"operation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L586-L604 |
132,250 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.flushPendingTruncate | private CompletableFuture<WriterFlushResult> flushPendingTruncate(WriterFlushResult flushResult, Duration timeout) {
StorageOperation op = this.operations.getFirst();
if (!isTruncateOperation(op) || !this.storage.supportsTruncation()) {
// Nothing to do.
return CompletableFuture.... | java | private CompletableFuture<WriterFlushResult> flushPendingTruncate(WriterFlushResult flushResult, Duration timeout) {
StorageOperation op = this.operations.getFirst();
if (!isTruncateOperation(op) || !this.storage.supportsTruncation()) {
// Nothing to do.
return CompletableFuture.... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"flushPendingTruncate",
"(",
"WriterFlushResult",
"flushResult",
",",
"Duration",
"timeout",
")",
"{",
"StorageOperation",
"op",
"=",
"this",
".",
"operations",
".",
"getFirst",
"(",
")",
";",
"if",
"(... | Flushes a pending StreamSegmentTruncateOperation, if that is the next pending one.
@param flushResult The FlushResult of the operation just prior to this.
@param timeout Timeout for the operation.
@return A CompletableFuture that, when completed, will contain the result from the flush operation, merged in with
the... | [
"Flushes",
"a",
"pending",
"StreamSegmentTruncateOperation",
"if",
"that",
"is",
"the",
"next",
"pending",
"one",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L721-L742 |
132,251 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.flushPendingAppends | private CompletableFuture<WriterFlushResult> flushPendingAppends(Duration timeout) {
// Gather an InputStream made up of all the operations we can flush.
FlushArgs flushArgs;
try {
flushArgs = getFlushArgs();
} catch (DataCorruptionException ex) {
return Futures.f... | java | private CompletableFuture<WriterFlushResult> flushPendingAppends(Duration timeout) {
// Gather an InputStream made up of all the operations we can flush.
FlushArgs flushArgs;
try {
flushArgs = getFlushArgs();
} catch (DataCorruptionException ex) {
return Futures.f... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"flushPendingAppends",
"(",
"Duration",
"timeout",
")",
"{",
"// Gather an InputStream made up of all the operations we can flush.",
"FlushArgs",
"flushArgs",
";",
"try",
"{",
"flushArgs",
"=",
"getFlushArgs",
"("... | Flushes all Append Operations that can be flushed up to the maximum allowed flush size.
@param timeout Timeout for the operation.
@return A CompletableFuture that, when completed, will contain the result from the flush operation. | [
"Flushes",
"all",
"Append",
"Operations",
"that",
"can",
"be",
"flushed",
"up",
"to",
"the",
"maximum",
"allowed",
"flush",
"size",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L750-L801 |
132,252 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.getFlushArgs | private FlushArgs getFlushArgs() throws DataCorruptionException {
StorageOperation first = this.operations.getFirst();
if (!(first instanceof AggregatedAppendOperation)) {
// Nothing to flush - first operation is not an AggregatedAppend.
return new FlushArgs(null, 0, Collections.... | java | private FlushArgs getFlushArgs() throws DataCorruptionException {
StorageOperation first = this.operations.getFirst();
if (!(first instanceof AggregatedAppendOperation)) {
// Nothing to flush - first operation is not an AggregatedAppend.
return new FlushArgs(null, 0, Collections.... | [
"private",
"FlushArgs",
"getFlushArgs",
"(",
")",
"throws",
"DataCorruptionException",
"{",
"StorageOperation",
"first",
"=",
"this",
".",
"operations",
".",
"getFirst",
"(",
")",
";",
"if",
"(",
"!",
"(",
"first",
"instanceof",
"AggregatedAppendOperation",
")",
... | Returns a FlushArgs which contains the data needing to be flushed to Storage.
@return The aggregated object that can be used for flushing.
@throws DataCorruptionException If a unable to retrieve required data from the Data Source. | [
"Returns",
"a",
"FlushArgs",
"which",
"contains",
"the",
"data",
"needing",
"to",
"be",
"flushed",
"to",
"Storage",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L809-L837 |
132,253 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.mergeWith | private CompletableFuture<WriterFlushResult> mergeWith(UpdateableSegmentMetadata transactionMetadata, MergeSegmentOperation mergeOp, TimeoutTimer timer) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "mergeWith", transactionMetadata.getId(), transactionMetadata.getName(), transact... | java | private CompletableFuture<WriterFlushResult> mergeWith(UpdateableSegmentMetadata transactionMetadata, MergeSegmentOperation mergeOp, TimeoutTimer timer) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "mergeWith", transactionMetadata.getId(), transactionMetadata.getName(), transact... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"mergeWith",
"(",
"UpdateableSegmentMetadata",
"transactionMetadata",
",",
"MergeSegmentOperation",
"mergeOp",
",",
"TimeoutTimer",
"timer",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterW... | Merges the Transaction StreamSegment with given metadata into this one at the current offset.
@param transactionMetadata The metadata of the Transaction StreamSegment to merge.
@param timer Timer for the operation.
@return A CompletableFuture that, when completed, will contain the number of bytes that we... | [
"Merges",
"the",
"Transaction",
"StreamSegment",
"with",
"given",
"metadata",
"into",
"this",
"one",
"at",
"the",
"current",
"offset",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L890-L938 |
132,254 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.mergeInStorage | private CompletableFuture<SegmentProperties> mergeInStorage(SegmentMetadata transactionMetadata, MergeSegmentOperation mergeOp, TimeoutTimer timer) {
return this.storage
.getStreamSegmentInfo(transactionMetadata.getName(), timer.getRemaining())
.thenAcceptAsync(transProperties ->... | java | private CompletableFuture<SegmentProperties> mergeInStorage(SegmentMetadata transactionMetadata, MergeSegmentOperation mergeOp, TimeoutTimer timer) {
return this.storage
.getStreamSegmentInfo(transactionMetadata.getName(), timer.getRemaining())
.thenAcceptAsync(transProperties ->... | [
"private",
"CompletableFuture",
"<",
"SegmentProperties",
">",
"mergeInStorage",
"(",
"SegmentMetadata",
"transactionMetadata",
",",
"MergeSegmentOperation",
"mergeOp",
",",
"TimeoutTimer",
"timer",
")",
"{",
"return",
"this",
".",
"storage",
".",
"getStreamSegmentInfo",
... | Executes the merge of the Source StreamSegment with given metadata into this one in Storage. | [
"Executes",
"the",
"merge",
"of",
"the",
"Source",
"StreamSegment",
"with",
"given",
"metadata",
"into",
"this",
"one",
"in",
"Storage",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L943-L982 |
132,255 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.mergeCompleted | private void mergeCompleted(SegmentProperties segmentProperties, UpdateableSegmentMetadata transactionMetadata, MergeSegmentOperation mergeOp) {
// We have processed a MergeSegmentOperation, pop the first operation off and decrement the counter.
StorageOperation processedOperation = this.operations.remo... | java | private void mergeCompleted(SegmentProperties segmentProperties, UpdateableSegmentMetadata transactionMetadata, MergeSegmentOperation mergeOp) {
// We have processed a MergeSegmentOperation, pop the first operation off and decrement the counter.
StorageOperation processedOperation = this.operations.remo... | [
"private",
"void",
"mergeCompleted",
"(",
"SegmentProperties",
"segmentProperties",
",",
"UpdateableSegmentMetadata",
"transactionMetadata",
",",
"MergeSegmentOperation",
"mergeOp",
")",
"{",
"// We have processed a MergeSegmentOperation, pop the first operation off and decrement the cou... | Executes post-Storage merge tasks, including state and metadata updates. | [
"Executes",
"post",
"-",
"Storage",
"merge",
"tasks",
"including",
"state",
"and",
"metadata",
"updates",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L987-L1011 |
132,256 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.sealIfNecessary | private CompletableFuture<WriterFlushResult> sealIfNecessary(WriterFlushResult flushResult, TimeoutTimer timer) {
if (!this.hasSealPending.get() || !(this.operations.getFirst() instanceof StreamSegmentSealOperation)) {
// Either no Seal is pending or the next operation is not a seal - we cannot exec... | java | private CompletableFuture<WriterFlushResult> sealIfNecessary(WriterFlushResult flushResult, TimeoutTimer timer) {
if (!this.hasSealPending.get() || !(this.operations.getFirst() instanceof StreamSegmentSealOperation)) {
// Either no Seal is pending or the next operation is not a seal - we cannot exec... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"sealIfNecessary",
"(",
"WriterFlushResult",
"flushResult",
",",
"TimeoutTimer",
"timer",
")",
"{",
"if",
"(",
"!",
"this",
".",
"hasSealPending",
".",
"get",
"(",
")",
"||",
"!",
"(",
"this",
".",... | Seals the StreamSegment in Storage, if necessary.
@param flushResult The FlushResult from a previous Flush operation. This will just be passed-through.
@param timer Timer for the operation.
@return The FlushResult passed in as an argument. | [
"Seals",
"the",
"StreamSegment",
"in",
"Storage",
"if",
"necessary",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1020-L1056 |
132,257 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.sealAttributes | private CompletableFuture<Void> sealAttributes(Duration timeout) {
return handleAttributeException(this.dataSource.sealAttributes(this.metadata.getId(), timeout));
} | java | private CompletableFuture<Void> sealAttributes(Duration timeout) {
return handleAttributeException(this.dataSource.sealAttributes(this.metadata.getId(), timeout));
} | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"sealAttributes",
"(",
"Duration",
"timeout",
")",
"{",
"return",
"handleAttributeException",
"(",
"this",
".",
"dataSource",
".",
"sealAttributes",
"(",
"this",
".",
"metadata",
".",
"getId",
"(",
")",
",",
"t... | Seals the Attribute Index for this Segment.
@param timeout Timeout for the operation.
@return A CompletableFuture that will indicate when the operation completed. | [
"Seals",
"the",
"Attribute",
"Index",
"for",
"this",
"Segment",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1064-L1066 |
132,258 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.reconcileOperation | private CompletableFuture<WriterFlushResult> reconcileOperation(StorageOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
CompletableFuture<WriterFlushResult> result;
if (isAppendOperation(op)) {
result = reconcileAppendOperation((AggregatedAppendOperation) op, storageInfo, ... | java | private CompletableFuture<WriterFlushResult> reconcileOperation(StorageOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
CompletableFuture<WriterFlushResult> result;
if (isAppendOperation(op)) {
result = reconcileAppendOperation((AggregatedAppendOperation) op, storageInfo, ... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"reconcileOperation",
"(",
"StorageOperation",
"op",
",",
"SegmentProperties",
"storageInfo",
",",
"TimeoutTimer",
"timer",
")",
"{",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"result",
";",
"if",
... | Attempts to reconcile the given StorageOperation.
@param op The Operation to reconcile.
@param storageInfo The current state of the Segment in Storage.
@param timer Timer for the operation.
@return A CompletableFuture containing a FlushResult with the number of bytes reconciled, or failed with a Reconci... | [
"Attempts",
"to",
"reconcile",
"the",
"given",
"StorageOperation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1277-L1294 |
132,259 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.reconcileAppendOperation | private CompletableFuture<WriterFlushResult> reconcileAppendOperation(AggregatedAppendOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
CompletableFuture<Boolean> reconcileResult;
WriterFlushResult flushResult = new WriterFlushResult();
if (op.getLength() > 0) {
// T... | java | private CompletableFuture<WriterFlushResult> reconcileAppendOperation(AggregatedAppendOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
CompletableFuture<Boolean> reconcileResult;
WriterFlushResult flushResult = new WriterFlushResult();
if (op.getLength() > 0) {
// T... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"reconcileAppendOperation",
"(",
"AggregatedAppendOperation",
"op",
",",
"SegmentProperties",
"storageInfo",
",",
"TimeoutTimer",
"timer",
")",
"{",
"CompletableFuture",
"<",
"Boolean",
">",
"reconcileResult",
... | Attempts to reconcile data and attributes for the given AggregatedAppendOperation. Since Append Operations can be partially
flushed, reconciliation may be for the full operation or for a part of it.
@param op The AggregatedAppendOperation to reconcile.
@param storageInfo The current state of the Segment in St... | [
"Attempts",
"to",
"reconcile",
"data",
"and",
"attributes",
"for",
"the",
"given",
"AggregatedAppendOperation",
".",
"Since",
"Append",
"Operations",
"can",
"be",
"partially",
"flushed",
"reconciliation",
"may",
"be",
"for",
"the",
"full",
"operation",
"or",
"for"... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1306-L1344 |
132,260 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.reconcileData | private CompletableFuture<Integer> reconcileData(AggregatedAppendOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
InputStream appendStream = this.dataSource.getAppendData(op.getStreamSegmentId(), op.getStreamSegmentOffset(), (int) op.getLength());
if (appendStream == null) {
... | java | private CompletableFuture<Integer> reconcileData(AggregatedAppendOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
InputStream appendStream = this.dataSource.getAppendData(op.getStreamSegmentId(), op.getStreamSegmentOffset(), (int) op.getLength());
if (appendStream == null) {
... | [
"private",
"CompletableFuture",
"<",
"Integer",
">",
"reconcileData",
"(",
"AggregatedAppendOperation",
"op",
",",
"SegmentProperties",
"storageInfo",
",",
"TimeoutTimer",
"timer",
")",
"{",
"InputStream",
"appendStream",
"=",
"this",
".",
"dataSource",
".",
"getAppen... | Attempts to reconcile the data for the given AggregatedAppendOperation. Since Append Operations can be partially
flushed, reconciliation may be for the full operation or for a part of it.
@param op The AggregatedAppendOperation to reconcile.
@param storageInfo The current state of the Segment in Storage.
@par... | [
"Attempts",
"to",
"reconcile",
"the",
"data",
"for",
"the",
"given",
"AggregatedAppendOperation",
".",
"Since",
"Append",
"Operations",
"can",
"be",
"partially",
"flushed",
"reconciliation",
"may",
"be",
"for",
"the",
"full",
"operation",
"or",
"for",
"a",
"part... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1356-L1384 |
132,261 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.reconcileMergeOperation | private CompletableFuture<WriterFlushResult> reconcileMergeOperation(MergeSegmentOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
// Verify that the transaction segment is still registered in metadata.
UpdateableSegmentMetadata transactionMeta = this.dataSource.getStreamSegmentMetadata... | java | private CompletableFuture<WriterFlushResult> reconcileMergeOperation(MergeSegmentOperation op, SegmentProperties storageInfo, TimeoutTimer timer) {
// Verify that the transaction segment is still registered in metadata.
UpdateableSegmentMetadata transactionMeta = this.dataSource.getStreamSegmentMetadata... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"reconcileMergeOperation",
"(",
"MergeSegmentOperation",
"op",
",",
"SegmentProperties",
"storageInfo",
",",
"TimeoutTimer",
"timer",
")",
"{",
"// Verify that the transaction segment is still registered in metadata.",
... | Attempts to reconcile the given MergeSegmentOperation.
@param op The Operation to reconcile.
@param storageInfo The current state of the Segment in Storage.
@param timer Timer for the operation
@return A CompletableFuture containing a FlushResult with the number of bytes reconciled, or failed with a Rec... | [
"Attempts",
"to",
"reconcile",
"the",
"given",
"MergeSegmentOperation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1405-L1454 |
132,262 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.reconcileSealOperation | private CompletableFuture<WriterFlushResult> reconcileSealOperation(SegmentProperties storageInfo, Duration timeout) {
// All we need to do is verify that the Segment is actually sealed in Storage. An exception to this rule is when
// the segment has a length of 0, which means it may not have been creat... | java | private CompletableFuture<WriterFlushResult> reconcileSealOperation(SegmentProperties storageInfo, Duration timeout) {
// All we need to do is verify that the Segment is actually sealed in Storage. An exception to this rule is when
// the segment has a length of 0, which means it may not have been creat... | [
"private",
"CompletableFuture",
"<",
"WriterFlushResult",
">",
"reconcileSealOperation",
"(",
"SegmentProperties",
"storageInfo",
",",
"Duration",
"timeout",
")",
"{",
"// All we need to do is verify that the Segment is actually sealed in Storage. An exception to this rule is when",
"/... | Attempts to reconcile a StreamSegmentSealOperation.
@param storageInfo The current state of the Segment in Storage.
@param timeout Timeout for the operation.
@return A CompletableFuture containing a FlushResult with the number of bytes reconciled, or failed with a ReconciliationFailureException,
if the operation c... | [
"Attempts",
"to",
"reconcile",
"a",
"StreamSegmentSealOperation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1464-L1480 |
132,263 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.reconcileAttributes | private CompletableFuture<Void> reconcileAttributes(AggregatedAppendOperation op, TimeoutTimer timer) {
// This operation must have previously succeeded if any of the following are true:
// - If the Attribute Index is sealed, and so is our Segment.
// - If the Attribute Index does not exist (del... | java | private CompletableFuture<Void> reconcileAttributes(AggregatedAppendOperation op, TimeoutTimer timer) {
// This operation must have previously succeeded if any of the following are true:
// - If the Attribute Index is sealed, and so is our Segment.
// - If the Attribute Index does not exist (del... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"reconcileAttributes",
"(",
"AggregatedAppendOperation",
"op",
",",
"TimeoutTimer",
"timer",
")",
"{",
"// This operation must have previously succeeded if any of the following are true:",
"// - If the Attribute Index is sealed, and so ... | Attempts to reconcile the attributes for a given operation. There is no verification done; this operation simply
re-writes all the attributes to the index, which is much more efficient than trying to read the values from the
index and then comparing them.
@param op The operation to reconcile.
@param timer ... | [
"Attempts",
"to",
"reconcile",
"the",
"attributes",
"for",
"a",
"given",
"operation",
".",
"There",
"is",
"no",
"verification",
"done",
";",
"this",
"operation",
"simply",
"re",
"-",
"writes",
"all",
"the",
"attributes",
"to",
"the",
"index",
"which",
"is",
... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1491-L1496 |
132,264 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.handleAttributeException | private CompletableFuture<Void> handleAttributeException(CompletableFuture<Void> future) {
return Futures.exceptionallyExpecting(
future,
ex -> (ex instanceof StreamSegmentSealedException && this.metadata.isSealedInStorage())
|| ((ex instanceof StreamSegme... | java | private CompletableFuture<Void> handleAttributeException(CompletableFuture<Void> future) {
return Futures.exceptionallyExpecting(
future,
ex -> (ex instanceof StreamSegmentSealedException && this.metadata.isSealedInStorage())
|| ((ex instanceof StreamSegme... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"handleAttributeException",
"(",
"CompletableFuture",
"<",
"Void",
">",
"future",
")",
"{",
"return",
"Futures",
".",
"exceptionallyExpecting",
"(",
"future",
",",
"ex",
"->",
"(",
"ex",
"instanceof",
"StreamSegmen... | Handles expected Attribute-related exceptions. Since the attribute index is a separate segment from the main one,
it is highly likely that it may get temporarily out of sync with the main one, thus causing spurious StreamSegmentSealedExceptions
or StreamSegmentNotExistsExceptions. If we get either of those, and they ar... | [
"Handles",
"expected",
"Attribute",
"-",
"related",
"exceptions",
".",
"Since",
"the",
"attribute",
"index",
"is",
"a",
"separate",
"segment",
"from",
"the",
"main",
"one",
"it",
"is",
"highly",
"likely",
"that",
"it",
"may",
"get",
"temporarily",
"out",
"of... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1504-L1511 |
132,265 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.checkValidStorageOperation | private void checkValidStorageOperation(StorageOperation operation) throws DataCorruptionException {
// StreamSegmentAppendOperations need to be pre-processed into CachedStreamSegmentAppendOperations.
Preconditions.checkArgument(!(operation instanceof StreamSegmentAppendOperation), "SegmentAggregator ca... | java | private void checkValidStorageOperation(StorageOperation operation) throws DataCorruptionException {
// StreamSegmentAppendOperations need to be pre-processed into CachedStreamSegmentAppendOperations.
Preconditions.checkArgument(!(operation instanceof StreamSegmentAppendOperation), "SegmentAggregator ca... | [
"private",
"void",
"checkValidStorageOperation",
"(",
"StorageOperation",
"operation",
")",
"throws",
"DataCorruptionException",
"{",
"// StreamSegmentAppendOperations need to be pre-processed into CachedStreamSegmentAppendOperations.",
"Preconditions",
".",
"checkArgument",
"(",
"!",
... | Validates that the given StorageOperation can be processed, given the current accumulated state of the Segment.
@param operation The operation to check.
@throws DataCorruptionException If any of the validations failed.
@throws IllegalArgumentException If the operation has an undefined Offset or Length (these are not ... | [
"Validates",
"that",
"the",
"given",
"StorageOperation",
"can",
"be",
"processed",
"given",
"the",
"current",
"accumulated",
"state",
"of",
"the",
"Segment",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1546-L1598 |
132,266 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.updateStatePostFlush | private WriterFlushResult updateStatePostFlush(FlushArgs flushArgs) {
// Update the metadata Storage Length.
long newLength = this.metadata.getStorageLength() + flushArgs.getLength();
this.metadata.setStorageLength(newLength);
// Remove operations from the outstanding list as long as ev... | java | private WriterFlushResult updateStatePostFlush(FlushArgs flushArgs) {
// Update the metadata Storage Length.
long newLength = this.metadata.getStorageLength() + flushArgs.getLength();
this.metadata.setStorageLength(newLength);
// Remove operations from the outstanding list as long as ev... | [
"private",
"WriterFlushResult",
"updateStatePostFlush",
"(",
"FlushArgs",
"flushArgs",
")",
"{",
"// Update the metadata Storage Length.",
"long",
"newLength",
"=",
"this",
".",
"metadata",
".",
"getStorageLength",
"(",
")",
"+",
"flushArgs",
".",
"getLength",
"(",
")... | Updates the metadata and the internal state after a flush was completed.
@param flushArgs The arguments used for flushing.
@return A FlushResult containing statistics about the flush operation. | [
"Updates",
"the",
"metadata",
"and",
"the",
"internal",
"state",
"after",
"a",
"flush",
"was",
"completed",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1606-L1629 |
132,267 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.updateStatePostSeal | private void updateStatePostSeal() {
// Update metadata.
this.metadata.markSealedInStorage();
this.operations.removeFirst();
// Validate we have no more unexpected items and then close (as we shouldn't be getting anything else).
assert this.operations.size() - this.truncateCount... | java | private void updateStatePostSeal() {
// Update metadata.
this.metadata.markSealedInStorage();
this.operations.removeFirst();
// Validate we have no more unexpected items and then close (as we shouldn't be getting anything else).
assert this.operations.size() - this.truncateCount... | [
"private",
"void",
"updateStatePostSeal",
"(",
")",
"{",
"// Update metadata.",
"this",
".",
"metadata",
".",
"markSealedInStorage",
"(",
")",
";",
"this",
".",
"operations",
".",
"removeFirst",
"(",
")",
";",
"// Validate we have no more unexpected items and then close... | Updates the metadata and the internal state after a Seal was completed. | [
"Updates",
"the",
"metadata",
"and",
"the",
"internal",
"state",
"after",
"a",
"Seal",
"was",
"completed",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1634-L1642 |
132,268 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.updateMetadata | private void updateMetadata(SegmentProperties segmentProperties) {
this.metadata.setStorageLength(segmentProperties.getLength());
if (segmentProperties.isSealed() && !this.metadata.isSealedInStorage()) {
this.metadata.markSealed();
this.metadata.markSealedInStorage();
}
... | java | private void updateMetadata(SegmentProperties segmentProperties) {
this.metadata.setStorageLength(segmentProperties.getLength());
if (segmentProperties.isSealed() && !this.metadata.isSealedInStorage()) {
this.metadata.markSealed();
this.metadata.markSealedInStorage();
}
... | [
"private",
"void",
"updateMetadata",
"(",
"SegmentProperties",
"segmentProperties",
")",
"{",
"this",
".",
"metadata",
".",
"setStorageLength",
"(",
"segmentProperties",
".",
"getLength",
"(",
")",
")",
";",
"if",
"(",
"segmentProperties",
".",
"isSealed",
"(",
... | Updates the metadata and based on the given SegmentProperties object.
@param segmentProperties The SegmentProperties object to update from. | [
"Updates",
"the",
"metadata",
"and",
"based",
"on",
"the",
"given",
"SegmentProperties",
"object",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1657-L1663 |
132,269 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.openWrite | private CompletableFuture<SegmentProperties> openWrite(String segmentName, AtomicReference<SegmentHandle> handleRef, Duration timeout) {
return this.storage
.openWrite(segmentName)
.thenComposeAsync(handle -> {
handleRef.set(handle);
return... | java | private CompletableFuture<SegmentProperties> openWrite(String segmentName, AtomicReference<SegmentHandle> handleRef, Duration timeout) {
return this.storage
.openWrite(segmentName)
.thenComposeAsync(handle -> {
handleRef.set(handle);
return... | [
"private",
"CompletableFuture",
"<",
"SegmentProperties",
">",
"openWrite",
"(",
"String",
"segmentName",
",",
"AtomicReference",
"<",
"SegmentHandle",
">",
"handleRef",
",",
"Duration",
"timeout",
")",
"{",
"return",
"this",
".",
"storage",
".",
"openWrite",
"(",... | Opens the given segment for writing.
@param segmentName The segment to open.
@param handleRef An AtomicReference that will contain the SegmentHandle for the opened segment.
@param timeout Timeout for the operation.
@return A Future that will contain information about the opened Segment. | [
"Opens",
"the",
"given",
"segment",
"for",
"writing",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1725-L1732 |
132,270 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.getExtendedAttributes | private Map<UUID, Long> getExtendedAttributes(AttributeUpdaterOperation operation) {
Collection<AttributeUpdate> updates = operation.getAttributeUpdates();
if (updates == null) {
return Collections.emptyMap();
}
return updates.stream()
.filter(au -> !Attribut... | java | private Map<UUID, Long> getExtendedAttributes(AttributeUpdaterOperation operation) {
Collection<AttributeUpdate> updates = operation.getAttributeUpdates();
if (updates == null) {
return Collections.emptyMap();
}
return updates.stream()
.filter(au -> !Attribut... | [
"private",
"Map",
"<",
"UUID",
",",
"Long",
">",
"getExtendedAttributes",
"(",
"AttributeUpdaterOperation",
"operation",
")",
"{",
"Collection",
"<",
"AttributeUpdate",
">",
"updates",
"=",
"operation",
".",
"getAttributeUpdates",
"(",
")",
";",
"if",
"(",
"upda... | Collects the extended Attributes from the AttributeUpdates of the given operation. | [
"Collects",
"the",
"extended",
"Attributes",
"from",
"the",
"AttributeUpdates",
"of",
"the",
"given",
"operation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L1737-L1746 |
132,271 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/SequentialAsyncProcessor.java | SequentialAsyncProcessor.runAsync | void runAsync() {
// Determine if a task is running. If so, record the fact we want to have it run again, otherwise reserve our spot.
synchronized (this) {
Exceptions.checkNotClosed(this.closed, this);
if (this.running) {
this.runAgain = true;
retu... | java | void runAsync() {
// Determine if a task is running. If so, record the fact we want to have it run again, otherwise reserve our spot.
synchronized (this) {
Exceptions.checkNotClosed(this.closed, this);
if (this.running) {
this.runAgain = true;
retu... | [
"void",
"runAsync",
"(",
")",
"{",
"// Determine if a task is running. If so, record the fact we want to have it run again, otherwise reserve our spot.",
"synchronized",
"(",
"this",
")",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
",",
"this",
")",
... | Executes one instance of the task, or queues it up at most once should the task be currently running. | [
"Executes",
"one",
"instance",
"of",
"the",
"task",
"or",
"queues",
"it",
"up",
"at",
"most",
"once",
"should",
"the",
"task",
"be",
"currently",
"running",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/SequentialAsyncProcessor.java#L64-L78 |
132,272 | pravega/pravega | controller/src/main/java/io/pravega/controller/server/rest/ModelHelper.java | ModelHelper.getCreateStreamConfig | public static final StreamConfiguration getCreateStreamConfig(final CreateStreamRequest createStreamRequest) {
ScalingPolicy scalingPolicy;
if (createStreamRequest.getScalingPolicy().getType() == ScalingConfig.TypeEnum.FIXED_NUM_SEGMENTS) {
scalingPolicy = ScalingPolicy.fixed(createStreamRequ... | java | public static final StreamConfiguration getCreateStreamConfig(final CreateStreamRequest createStreamRequest) {
ScalingPolicy scalingPolicy;
if (createStreamRequest.getScalingPolicy().getType() == ScalingConfig.TypeEnum.FIXED_NUM_SEGMENTS) {
scalingPolicy = ScalingPolicy.fixed(createStreamRequ... | [
"public",
"static",
"final",
"StreamConfiguration",
"getCreateStreamConfig",
"(",
"final",
"CreateStreamRequest",
"createStreamRequest",
")",
"{",
"ScalingPolicy",
"scalingPolicy",
";",
"if",
"(",
"createStreamRequest",
".",
"getScalingPolicy",
"(",
")",
".",
"getType",
... | This method translates the REST request object CreateStreamRequest into internal object StreamConfiguration.
@param createStreamRequest An object conforming to the createStream REST API json
@return StreamConfiguration internal object | [
"This",
"method",
"translates",
"the",
"REST",
"request",
"object",
"CreateStreamRequest",
"into",
"internal",
"object",
"StreamConfiguration",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rest/ModelHelper.java#L34-L69 |
132,273 | pravega/pravega | controller/src/main/java/io/pravega/controller/server/rest/ModelHelper.java | ModelHelper.getUpdateStreamConfig | public static final StreamConfiguration getUpdateStreamConfig(final UpdateStreamRequest updateStreamRequest) {
ScalingPolicy scalingPolicy;
if (updateStreamRequest.getScalingPolicy().getType() == ScalingConfig.TypeEnum.FIXED_NUM_SEGMENTS) {
scalingPolicy = ScalingPolicy.fixed(updateStreamReq... | java | public static final StreamConfiguration getUpdateStreamConfig(final UpdateStreamRequest updateStreamRequest) {
ScalingPolicy scalingPolicy;
if (updateStreamRequest.getScalingPolicy().getType() == ScalingConfig.TypeEnum.FIXED_NUM_SEGMENTS) {
scalingPolicy = ScalingPolicy.fixed(updateStreamReq... | [
"public",
"static",
"final",
"StreamConfiguration",
"getUpdateStreamConfig",
"(",
"final",
"UpdateStreamRequest",
"updateStreamRequest",
")",
"{",
"ScalingPolicy",
"scalingPolicy",
";",
"if",
"(",
"updateStreamRequest",
".",
"getScalingPolicy",
"(",
")",
".",
"getType",
... | This method translates the REST request object UpdateStreamRequest into internal object StreamConfiguration.
@param updateStreamRequest An object conforming to the updateStreamConfig REST API json
@return StreamConfiguration internal object | [
"This",
"method",
"translates",
"the",
"REST",
"request",
"object",
"UpdateStreamRequest",
"into",
"internal",
"object",
"StreamConfiguration",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rest/ModelHelper.java#L77-L112 |
132,274 | pravega/pravega | controller/src/main/java/io/pravega/controller/server/rest/ModelHelper.java | ModelHelper.encodeStreamResponse | public static final StreamProperty encodeStreamResponse(String scope, String streamName, final StreamConfiguration streamConfiguration) {
ScalingConfig scalingPolicy = new ScalingConfig();
if (streamConfiguration.getScalingPolicy().getScaleType() == ScalingPolicy.ScaleType.FIXED_NUM_SEGMENTS) {
... | java | public static final StreamProperty encodeStreamResponse(String scope, String streamName, final StreamConfiguration streamConfiguration) {
ScalingConfig scalingPolicy = new ScalingConfig();
if (streamConfiguration.getScalingPolicy().getScaleType() == ScalingPolicy.ScaleType.FIXED_NUM_SEGMENTS) {
... | [
"public",
"static",
"final",
"StreamProperty",
"encodeStreamResponse",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"final",
"StreamConfiguration",
"streamConfiguration",
")",
"{",
"ScalingConfig",
"scalingPolicy",
"=",
"new",
"ScalingConfig",
"(",
")",
"... | The method translates the internal object StreamConfiguration into REST response object.
@param scope the scope of the stream
@param streamName the name of the stream
@param streamConfiguration The configuration of stream
@return Stream properties wrapped in StreamResponse object | [
"The",
"method",
"translates",
"the",
"internal",
"object",
"StreamConfiguration",
"into",
"REST",
"response",
"object",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rest/ModelHelper.java#L122-L158 |
132,275 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilderConfig.java | ServiceBuilderConfig.getConfig | public <T> T getConfig(Supplier<? extends ConfigBuilder<? extends T>> constructor) {
return constructor.get()
.rebase(this.properties)
.build();
} | java | public <T> T getConfig(Supplier<? extends ConfigBuilder<? extends T>> constructor) {
return constructor.get()
.rebase(this.properties)
.build();
} | [
"public",
"<",
"T",
">",
"T",
"getConfig",
"(",
"Supplier",
"<",
"?",
"extends",
"ConfigBuilder",
"<",
"?",
"extends",
"T",
">",
">",
"constructor",
")",
"{",
"return",
"constructor",
".",
"get",
"(",
")",
".",
"rebase",
"(",
"this",
".",
"properties",... | Gets a new instance of a Configuration for this builder.
@param constructor A Supplier for a ConfigBuilder for the given Configuration.
@param <T> The type of the Configuration to instantiate.
@return The new instance of a Configuration for this builder. | [
"Gets",
"a",
"new",
"instance",
"of",
"a",
"Configuration",
"for",
"this",
"builder",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilderConfig.java#L66-L70 |
132,276 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilderConfig.java | ServiceBuilderConfig.store | public void store(File file) throws IOException {
try (val s = new FileOutputStream(file, false)) {
this.properties.store(s, "");
}
} | java | public void store(File file) throws IOException {
try (val s = new FileOutputStream(file, false)) {
this.properties.store(s, "");
}
} | [
"public",
"void",
"store",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"val",
"s",
"=",
"new",
"FileOutputStream",
"(",
"file",
",",
"false",
")",
")",
"{",
"this",
".",
"properties",
".",
"store",
"(",
"s",
",",
"\"\"",
")",
... | Stores the contents of the ServiceBuilderConfig into the given File.
@param file The file to store the contents in.
@throws IOException If an exception occurred. | [
"Stores",
"the",
"contents",
"of",
"the",
"ServiceBuilderConfig",
"into",
"the",
"given",
"File",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilderConfig.java#L78-L82 |
132,277 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilderConfig.java | ServiceBuilderConfig.getDefaultConfig | public static ServiceBuilderConfig getDefaultConfig() {
// All component configs should have defaults built-in, so no need to override them here.
return new Builder()
.include(ServiceConfig.builder().with(ServiceConfig.CONTAINER_COUNT, 1))
.build();
} | java | public static ServiceBuilderConfig getDefaultConfig() {
// All component configs should have defaults built-in, so no need to override them here.
return new Builder()
.include(ServiceConfig.builder().with(ServiceConfig.CONTAINER_COUNT, 1))
.build();
} | [
"public",
"static",
"ServiceBuilderConfig",
"getDefaultConfig",
"(",
")",
"{",
"// All component configs should have defaults built-in, so no need to override them here.",
"return",
"new",
"Builder",
"(",
")",
".",
"include",
"(",
"ServiceConfig",
".",
"builder",
"(",
")",
... | Gets a default set of configuration values, in absence of any real configuration.
These configuration values are the default ones from all component configurations, except that it will
create only one container to host segments.
@return The default set of configuration values. | [
"Gets",
"a",
"default",
"set",
"of",
"configuration",
"values",
"in",
"absence",
"of",
"any",
"real",
"configuration",
".",
"These",
"configuration",
"values",
"are",
"the",
"default",
"ones",
"from",
"all",
"component",
"configurations",
"except",
"that",
"it",... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilderConfig.java#L101-L106 |
132,278 | pravega/pravega | common/src/main/java/io/pravega/common/util/ConfigBuilder.java | ConfigBuilder.with | public <V> ConfigBuilder<T> with(Property<V> property, V value) {
String key = String.format("%s.%s", this.namespace, property.getName());
this.properties.setProperty(key, value == null ? "" : value.toString());
return this;
} | java | public <V> ConfigBuilder<T> with(Property<V> property, V value) {
String key = String.format("%s.%s", this.namespace, property.getName());
this.properties.setProperty(key, value == null ? "" : value.toString());
return this;
} | [
"public",
"<",
"V",
">",
"ConfigBuilder",
"<",
"T",
">",
"with",
"(",
"Property",
"<",
"V",
">",
"property",
",",
"V",
"value",
")",
"{",
"String",
"key",
"=",
"String",
".",
"format",
"(",
"\"%s.%s\"",
",",
"this",
".",
"namespace",
",",
"property",... | Includes the given property and its value in the builder.
@param property The property to set.
@param value The value of the property. This must be of the same type as accepted by the Property.
In case a `null` value is sent, the value of the property will be set to empty string.
@param <V> Type of the propert... | [
"Includes",
"the",
"given",
"property",
"and",
"its",
"value",
"in",
"the",
"builder",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ConfigBuilder.java#L76-L80 |
132,279 | pravega/pravega | common/src/main/java/io/pravega/common/util/ConfigBuilder.java | ConfigBuilder.withUnsafe | public ConfigBuilder<T> withUnsafe(Property<?> property, Object value) {
String key = String.format("%s.%s", this.namespace, property.getName());
this.properties.setProperty(key, value.toString());
return this;
} | java | public ConfigBuilder<T> withUnsafe(Property<?> property, Object value) {
String key = String.format("%s.%s", this.namespace, property.getName());
this.properties.setProperty(key, value.toString());
return this;
} | [
"public",
"ConfigBuilder",
"<",
"T",
">",
"withUnsafe",
"(",
"Property",
"<",
"?",
">",
"property",
",",
"Object",
"value",
")",
"{",
"String",
"key",
"=",
"String",
".",
"format",
"(",
"\"%s.%s\"",
",",
"this",
".",
"namespace",
",",
"property",
".",
... | Includes the given property and its value in the builder, without Property-Value type-enforcement.
@param property The property to set.
@param value The value of the property.
@return This instance. | [
"Includes",
"the",
"given",
"property",
"and",
"its",
"value",
"in",
"the",
"builder",
"without",
"Property",
"-",
"Value",
"type",
"-",
"enforcement",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ConfigBuilder.java#L89-L93 |
132,280 | pravega/pravega | segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/admin/commands/BookKeeperCommand.java | BookKeeperCommand.outputLogSummary | protected void outputLogSummary(int logId, ReadOnlyLogMetadata m) {
if (m == null) {
output("Log %d: No metadata.", logId);
} else {
output("Log %d: Epoch=%d, Version=%d, Enabled=%s, Ledgers=%d, Truncation={%s}", logId,
m.getEpoch(), m.getUpdateVersion(), m.is... | java | protected void outputLogSummary(int logId, ReadOnlyLogMetadata m) {
if (m == null) {
output("Log %d: No metadata.", logId);
} else {
output("Log %d: Epoch=%d, Version=%d, Enabled=%s, Ledgers=%d, Truncation={%s}", logId,
m.getEpoch(), m.getUpdateVersion(), m.is... | [
"protected",
"void",
"outputLogSummary",
"(",
"int",
"logId",
",",
"ReadOnlyLogMetadata",
"m",
")",
"{",
"if",
"(",
"m",
"==",
"null",
")",
"{",
"output",
"(",
"\"Log %d: No metadata.\"",
",",
"logId",
")",
";",
"}",
"else",
"{",
"output",
"(",
"\"Log %d: ... | Outputs a summary for the given Log.
@param logId The Log Id.
@param m The Log Metadata for the given Log Id. | [
"Outputs",
"a",
"summary",
"for",
"the",
"given",
"Log",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/admin/commands/BookKeeperCommand.java#L42-L49 |
132,281 | pravega/pravega | segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/admin/commands/BookKeeperCommand.java | BookKeeperCommand.createContext | protected Context createContext() throws DurableDataLogException {
val serviceConfig = getServiceConfig();
val bkConfig = getCommandArgs().getState().getConfigBuilder()
.include(BookKeeperConfig.builder().with(BookKeeperConfig.ZK_ADDRESS, serviceConfig.getZkURL()))... | java | protected Context createContext() throws DurableDataLogException {
val serviceConfig = getServiceConfig();
val bkConfig = getCommandArgs().getState().getConfigBuilder()
.include(BookKeeperConfig.builder().with(BookKeeperConfig.ZK_ADDRESS, serviceConfig.getZkURL()))... | [
"protected",
"Context",
"createContext",
"(",
")",
"throws",
"DurableDataLogException",
"{",
"val",
"serviceConfig",
"=",
"getServiceConfig",
"(",
")",
";",
"val",
"bkConfig",
"=",
"getCommandArgs",
"(",
")",
".",
"getState",
"(",
")",
".",
"getConfigBuilder",
"... | Creates a new Context to be used by the BookKeeper command.
@return A new Context.
@throws DurableDataLogException If the BookKeeperLogFactory could not be initialized. | [
"Creates",
"a",
"new",
"Context",
"to",
"be",
"used",
"by",
"the",
"BookKeeper",
"command",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/admin/commands/BookKeeperCommand.java#L57-L73 |
132,282 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableKeyBatch.java | TableKeyBatch.add | void add(TableKey key, UUID hash, int length) {
Item item = new Item(key, hash, this.length);
this.items.add(item);
this.length += length;
if (key.hasVersion()) {
this.versionedItems.add(item);
}
} | java | void add(TableKey key, UUID hash, int length) {
Item item = new Item(key, hash, this.length);
this.items.add(item);
this.length += length;
if (key.hasVersion()) {
this.versionedItems.add(item);
}
} | [
"void",
"add",
"(",
"TableKey",
"key",
",",
"UUID",
"hash",
",",
"int",
"length",
")",
"{",
"Item",
"item",
"=",
"new",
"Item",
"(",
"key",
",",
"hash",
",",
"this",
".",
"length",
")",
";",
"this",
".",
"items",
".",
"add",
"(",
"item",
")",
"... | Adds a new Item to this TableKeyBatch.
@param key The {@link TableKey} representing the Key to add.
@param hash The Key Hash corresponding to the Key.
@param length The serialized length of this Batch Entry. Note that this will almost always be larger than the size
of the key, as it encompasses the whole Table En... | [
"Adds",
"a",
"new",
"Item",
"to",
"this",
"TableKeyBatch",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableKeyBatch.java#L68-L75 |
132,283 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.processWritesSync | private void processWritesSync() {
if (this.closed.get()) {
// BookKeeperLog is closed. No point in trying anything else.
return;
}
if (getWriteLedger().ledger.isClosed()) {
// Current ledger is closed. Execute the rollover processor to safely create a new le... | java | private void processWritesSync() {
if (this.closed.get()) {
// BookKeeperLog is closed. No point in trying anything else.
return;
}
if (getWriteLedger().ledger.isClosed()) {
// Current ledger is closed. Execute the rollover processor to safely create a new le... | [
"private",
"void",
"processWritesSync",
"(",
")",
"{",
"if",
"(",
"this",
".",
"closed",
".",
"get",
"(",
")",
")",
"{",
"// BookKeeperLog is closed. No point in trying anything else.",
"return",
";",
"}",
"if",
"(",
"getWriteLedger",
"(",
")",
".",
"ledger",
... | Write Processor main loop. This method is not thread safe and should only be invoked as part of the Write Processor. | [
"Write",
"Processor",
"main",
"loop",
".",
"This",
"method",
"is",
"not",
"thread",
"safe",
"and",
"should",
"only",
"be",
"invoked",
"as",
"part",
"of",
"the",
"Write",
"Processor",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L355-L369 |
132,284 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.processPendingWrites | private boolean processPendingWrites() {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "processPendingWrites");
// Clean up the write queue of all finished writes that are complete (successfully or failed for good)
val cs = this.writes.removeFinishedWrites();
... | java | private boolean processPendingWrites() {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "processPendingWrites");
// Clean up the write queue of all finished writes that are complete (successfully or failed for good)
val cs = this.writes.removeFinishedWrites();
... | [
"private",
"boolean",
"processPendingWrites",
"(",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"traceObjectId",
",",
"\"processPendingWrites\"",
")",
";",
"// Clean up the write queue of all finished write... | Executes pending Writes to BookKeeper. This method is not thread safe and should only be invoked as part of
the Write Processor.
@return True if the no errors, false if at least one write failed. | [
"Executes",
"pending",
"Writes",
"to",
"BookKeeper",
".",
"This",
"method",
"is",
"not",
"thread",
"safe",
"and",
"should",
"only",
"be",
"invoked",
"as",
"part",
"of",
"the",
"Write",
"Processor",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L376-L409 |
132,285 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.getWritesToExecute | private List<Write> getWritesToExecute() {
// Calculate how much estimated space there is in the current ledger.
final long maxTotalSize = this.config.getBkLedgerMaxSize() - getWriteLedger().ledger.getLength();
// Get the writes to execute from the queue.
List<Write> toExecute = this.wr... | java | private List<Write> getWritesToExecute() {
// Calculate how much estimated space there is in the current ledger.
final long maxTotalSize = this.config.getBkLedgerMaxSize() - getWriteLedger().ledger.getLength();
// Get the writes to execute from the queue.
List<Write> toExecute = this.wr... | [
"private",
"List",
"<",
"Write",
">",
"getWritesToExecute",
"(",
")",
"{",
"// Calculate how much estimated space there is in the current ledger.",
"final",
"long",
"maxTotalSize",
"=",
"this",
".",
"config",
".",
"getBkLedgerMaxSize",
"(",
")",
"-",
"getWriteLedger",
"... | Collects an ordered list of Writes to execute to BookKeeper.
@return The list of Writes to execute. | [
"Collects",
"an",
"ordered",
"list",
"of",
"Writes",
"to",
"execute",
"to",
"BookKeeper",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L416-L432 |
132,286 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.executeWrites | private boolean executeWrites(List<Write> toExecute) {
log.debug("{}: Executing {} writes.", this.traceObjectId, toExecute.size());
for (int i = 0; i < toExecute.size(); i++) {
Write w = toExecute.get(i);
try {
// Record the beginning of a new attempt.
... | java | private boolean executeWrites(List<Write> toExecute) {
log.debug("{}: Executing {} writes.", this.traceObjectId, toExecute.size());
for (int i = 0; i < toExecute.size(); i++) {
Write w = toExecute.get(i);
try {
// Record the beginning of a new attempt.
... | [
"private",
"boolean",
"executeWrites",
"(",
"List",
"<",
"Write",
">",
"toExecute",
")",
"{",
"log",
".",
"debug",
"(",
"\"{}: Executing {} writes.\"",
",",
"this",
".",
"traceObjectId",
",",
"toExecute",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"int",... | Executes the given Writes to BookKeeper.
@param toExecute The Writes to execute.
@return True if all the writes succeeded, false if at least one failed (if a Write failed, all subsequent writes
will be failed as well). | [
"Executes",
"the",
"given",
"Writes",
"to",
"BookKeeper",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L441-L471 |
132,287 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.fetchLastAddConfirmed | @SneakyThrows(DurableDataLogException.class)
private long fetchLastAddConfirmed(WriteLedger writeLedger, Map<Long, Long> lastAddsConfirmed) {
long ledgerId = writeLedger.ledger.getId();
long lac = lastAddsConfirmed.getOrDefault(ledgerId, -1L);
long traceId = LoggerHelpers.traceEnterWithConte... | java | @SneakyThrows(DurableDataLogException.class)
private long fetchLastAddConfirmed(WriteLedger writeLedger, Map<Long, Long> lastAddsConfirmed) {
long ledgerId = writeLedger.ledger.getId();
long lac = lastAddsConfirmed.getOrDefault(ledgerId, -1L);
long traceId = LoggerHelpers.traceEnterWithConte... | [
"@",
"SneakyThrows",
"(",
"DurableDataLogException",
".",
"class",
")",
"private",
"long",
"fetchLastAddConfirmed",
"(",
"WriteLedger",
"writeLedger",
",",
"Map",
"<",
"Long",
",",
"Long",
">",
"lastAddsConfirmed",
")",
"{",
"long",
"ledgerId",
"=",
"writeLedger",... | Reliably gets the LastAddConfirmed for the WriteLedger
@param writeLedger The WriteLedger to query.
@param lastAddsConfirmed A Map of LedgerIds to LastAddConfirmed for each known ledger id. This is used as a cache
and will be updated if necessary.
@return The LastAddConfirmed for the WriteLedger. | [
"Reliably",
"gets",
"the",
"LastAddConfirmed",
"for",
"the",
"WriteLedger"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L523-L544 |
132,288 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.addCallback | private void addCallback(int rc, LedgerHandle handle, long entryId, Object ctx) {
Write write = (Write) ctx;
try {
assert handle.getId() == write.getWriteLedger().ledger.getId()
: "Handle.Id mismatch: " + write.getWriteLedger().ledger.getId() + " vs " + handle.getId();
... | java | private void addCallback(int rc, LedgerHandle handle, long entryId, Object ctx) {
Write write = (Write) ctx;
try {
assert handle.getId() == write.getWriteLedger().ledger.getId()
: "Handle.Id mismatch: " + write.getWriteLedger().ledger.getId() + " vs " + handle.getId();
... | [
"private",
"void",
"addCallback",
"(",
"int",
"rc",
",",
"LedgerHandle",
"handle",
",",
"long",
"entryId",
",",
"Object",
"ctx",
")",
"{",
"Write",
"write",
"=",
"(",
"Write",
")",
"ctx",
";",
"try",
"{",
"assert",
"handle",
".",
"getId",
"(",
")",
"... | Callback for BookKeeper appends.
@param rc Response Code.
@param handle LedgerHandle.
@param entryId Assigned EntryId.
@param ctx Write Context. In our case, the Write we were writing. | [
"Callback",
"for",
"BookKeeper",
"appends",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L554-L585 |
132,289 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.completeWrite | private void completeWrite(Write write) {
Timer t = write.complete();
if (t != null) {
this.metrics.bookKeeperWriteCompleted(write.data.getLength(), t.getElapsed());
}
} | java | private void completeWrite(Write write) {
Timer t = write.complete();
if (t != null) {
this.metrics.bookKeeperWriteCompleted(write.data.getLength(), t.getElapsed());
}
} | [
"private",
"void",
"completeWrite",
"(",
"Write",
"write",
")",
"{",
"Timer",
"t",
"=",
"write",
".",
"complete",
"(",
")",
";",
"if",
"(",
"t",
"!=",
"null",
")",
"{",
"this",
".",
"metrics",
".",
"bookKeeperWriteCompleted",
"(",
"write",
".",
"data",... | Completes the given Write and makes any necessary internal updates.
@param write The write to complete. | [
"Completes",
"the",
"given",
"Write",
"and",
"makes",
"any",
"necessary",
"internal",
"updates",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L592-L597 |
132,290 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.handleWriteException | private void handleWriteException(Throwable ex) {
if (ex instanceof ObjectClosedException && !this.closed.get()) {
log.warn("{}: Caught ObjectClosedException but not closed; closing now.", this.traceObjectId, ex);
close();
}
} | java | private void handleWriteException(Throwable ex) {
if (ex instanceof ObjectClosedException && !this.closed.get()) {
log.warn("{}: Caught ObjectClosedException but not closed; closing now.", this.traceObjectId, ex);
close();
}
} | [
"private",
"void",
"handleWriteException",
"(",
"Throwable",
"ex",
")",
"{",
"if",
"(",
"ex",
"instanceof",
"ObjectClosedException",
"&&",
"!",
"this",
".",
"closed",
".",
"get",
"(",
")",
")",
"{",
"log",
".",
"warn",
"(",
"\"{}: Caught ObjectClosedException ... | Handles a general Write exception. | [
"Handles",
"a",
"general",
"Write",
"exception",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L602-L607 |
132,291 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.handleWriteException | private void handleWriteException(int responseCode, Write write) {
assert responseCode != BKException.Code.OK : "cannot handle an exception when responseCode == " + BKException.Code.OK;
Exception ex = BKException.create(responseCode);
try {
if (ex instanceof BKException.BKLedgerFence... | java | private void handleWriteException(int responseCode, Write write) {
assert responseCode != BKException.Code.OK : "cannot handle an exception when responseCode == " + BKException.Code.OK;
Exception ex = BKException.create(responseCode);
try {
if (ex instanceof BKException.BKLedgerFence... | [
"private",
"void",
"handleWriteException",
"(",
"int",
"responseCode",
",",
"Write",
"write",
")",
"{",
"assert",
"responseCode",
"!=",
"BKException",
".",
"Code",
".",
"OK",
":",
"\"cannot handle an exception when responseCode == \"",
"+",
"BKException",
".",
"Code",... | Handles an exception after a Write operation, converts it to a Pravega Exception and completes the given future
exceptionally using it.
@param responseCode The BookKeeper response code to interpret.
@param write The Write that failed. | [
"Handles",
"an",
"exception",
"after",
"a",
"Write",
"operation",
"converts",
"it",
"to",
"a",
"Pravega",
"Exception",
"and",
"completes",
"the",
"given",
"future",
"exceptionally",
"using",
"it",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L616-L643 |
132,292 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.isRetryable | private static boolean isRetryable(Throwable ex) {
ex = Exceptions.unwrap(ex);
return ex instanceof WriteFailureException
|| ex instanceof DataLogNotAvailableException;
} | java | private static boolean isRetryable(Throwable ex) {
ex = Exceptions.unwrap(ex);
return ex instanceof WriteFailureException
|| ex instanceof DataLogNotAvailableException;
} | [
"private",
"static",
"boolean",
"isRetryable",
"(",
"Throwable",
"ex",
")",
"{",
"ex",
"=",
"Exceptions",
".",
"unwrap",
"(",
"ex",
")",
";",
"return",
"ex",
"instanceof",
"WriteFailureException",
"||",
"ex",
"instanceof",
"DataLogNotAvailableException",
";",
"}... | Determines whether the given exception can be retried. | [
"Determines",
"whether",
"the",
"given",
"exception",
"can",
"be",
"retried",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L648-L652 |
132,293 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.updateMetadata | private LogMetadata updateMetadata(LogMetadata currentMetadata, LedgerHandle newLedger, boolean clearEmptyLedgers) throws DurableDataLogException {
boolean create = currentMetadata == null;
if (create) {
// This is the first ledger ever in the metadata.
currentMetadata = new LogM... | java | private LogMetadata updateMetadata(LogMetadata currentMetadata, LedgerHandle newLedger, boolean clearEmptyLedgers) throws DurableDataLogException {
boolean create = currentMetadata == null;
if (create) {
// This is the first ledger ever in the metadata.
currentMetadata = new LogM... | [
"private",
"LogMetadata",
"updateMetadata",
"(",
"LogMetadata",
"currentMetadata",
",",
"LedgerHandle",
"newLedger",
",",
"boolean",
"clearEmptyLedgers",
")",
"throws",
"DurableDataLogException",
"{",
"boolean",
"create",
"=",
"currentMetadata",
"==",
"null",
";",
"if",... | Updates the metadata and persists it as a result of adding a new Ledger.
@param currentMetadata The current metadata.
@param newLedger The newly added Ledger.
@param clearEmptyLedgers If true, the new metadata will not not contain any pointers to empty Ledgers. Setting this
to true will not remove a pointer ... | [
"Updates",
"the",
"metadata",
"and",
"persists",
"it",
"as",
"a",
"result",
"of",
"adding",
"a",
"new",
"Ledger",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L742-L770 |
132,294 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.persistMetadata | private void persistMetadata(LogMetadata metadata, boolean create) throws DurableDataLogException {
try {
byte[] serializedMetadata = LogMetadata.SERIALIZER.serialize(metadata).getCopy();
if (create) {
this.zkClient.create()
.creatingParentsIf... | java | private void persistMetadata(LogMetadata metadata, boolean create) throws DurableDataLogException {
try {
byte[] serializedMetadata = LogMetadata.SERIALIZER.serialize(metadata).getCopy();
if (create) {
this.zkClient.create()
.creatingParentsIf... | [
"private",
"void",
"persistMetadata",
"(",
"LogMetadata",
"metadata",
",",
"boolean",
"create",
")",
"throws",
"DurableDataLogException",
"{",
"try",
"{",
"byte",
"[",
"]",
"serializedMetadata",
"=",
"LogMetadata",
".",
"SERIALIZER",
".",
"serialize",
"(",
"metada... | Persists the given metadata into ZooKeeper.
@param metadata The LogMetadata to persist. At the end of this method, this metadata will have its Version updated
to the one in ZooKeeper.
@param create Whether to create (true) or update (false) the data in ZooKeeper.
@throws DataLogWriterNotPrimaryException If the metad... | [
"Persists",
"the",
"given",
"metadata",
"into",
"ZooKeeper",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L782-L812 |
132,295 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.getLedgerIdsToDelete | @GuardedBy("lock")
private List<Long> getLedgerIdsToDelete(LogMetadata oldMetadata, LogMetadata currentMetadata) {
if (oldMetadata == null) {
return Collections.emptyList();
}
val existingIds = currentMetadata.getLedgers().stream()
.map(LedgerMetadata::getLedgerI... | java | @GuardedBy("lock")
private List<Long> getLedgerIdsToDelete(LogMetadata oldMetadata, LogMetadata currentMetadata) {
if (oldMetadata == null) {
return Collections.emptyList();
}
val existingIds = currentMetadata.getLedgers().stream()
.map(LedgerMetadata::getLedgerI... | [
"@",
"GuardedBy",
"(",
"\"lock\"",
")",
"private",
"List",
"<",
"Long",
">",
"getLedgerIdsToDelete",
"(",
"LogMetadata",
"oldMetadata",
",",
"LogMetadata",
"currentMetadata",
")",
"{",
"if",
"(",
"oldMetadata",
"==",
"null",
")",
"{",
"return",
"Collections",
... | Determines which Ledger Ids are safe to delete from BookKeeper.
@param oldMetadata A pointer to the previous version of the metadata, that contains all Ledgers eligible for
deletion. Only those Ledgers that do not exist in currentMetadata will be selected.
@param currentMetadata A pointer to the current version of... | [
"Determines",
"which",
"Ledger",
"Ids",
"are",
"safe",
"to",
"delete",
"from",
"BookKeeper",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L897-L910 |
132,296 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentMetadata.java | StreamSegmentMetadata.setStorageLength | @Override
public synchronized void setStorageLength(long value) {
Exceptions.checkArgument(value >= 0, "value", "Storage Length must be a non-negative number.");
Exceptions.checkArgument(value >= this.storageLength, "value", "New Storage Length cannot be smaller than the previous one.");
lo... | java | @Override
public synchronized void setStorageLength(long value) {
Exceptions.checkArgument(value >= 0, "value", "Storage Length must be a non-negative number.");
Exceptions.checkArgument(value >= this.storageLength, "value", "New Storage Length cannot be smaller than the previous one.");
lo... | [
"@",
"Override",
"public",
"synchronized",
"void",
"setStorageLength",
"(",
"long",
"value",
")",
"{",
"Exceptions",
".",
"checkArgument",
"(",
"value",
">=",
"0",
",",
"\"value\"",
",",
"\"Storage Length must be a non-negative number.\"",
")",
";",
"Exceptions",
".... | region UpdateableSegmentMetadata Implementation | [
"region",
"UpdateableSegmentMetadata",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentMetadata.java#L204-L211 |
132,297 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentMetadata.java | StreamSegmentMetadata.cleanupAttributes | synchronized int cleanupAttributes(int maximumAttributeCount, long lastUsedCutoff) {
if (this.extendedAttributes.size() <= maximumAttributeCount) {
// Haven't reached the limit yet.
return 0;
}
// Collect candidates and order them by lastUsed (oldest to newest).
... | java | synchronized int cleanupAttributes(int maximumAttributeCount, long lastUsedCutoff) {
if (this.extendedAttributes.size() <= maximumAttributeCount) {
// Haven't reached the limit yet.
return 0;
}
// Collect candidates and order them by lastUsed (oldest to newest).
... | [
"synchronized",
"int",
"cleanupAttributes",
"(",
"int",
"maximumAttributeCount",
",",
"long",
"lastUsedCutoff",
")",
"{",
"if",
"(",
"this",
".",
"extendedAttributes",
".",
"size",
"(",
")",
"<=",
"maximumAttributeCount",
")",
"{",
"// Haven't reached the limit yet.",... | Evicts those Extended Attributes from memory that have a LastUsed value prior to the given cutoff.
@param maximumAttributeCount The maximum number of Extended Attributes per Segment. Cleanup will only be performed
if there are at least this many Extended Attributes in memory.
@param lastUsedCutoff The cutoff va... | [
"Evicts",
"those",
"Extended",
"Attributes",
"from",
"memory",
"that",
"have",
"a",
"LastUsed",
"value",
"prior",
"to",
"the",
"given",
"cutoff",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentMetadata.java#L371-L397 |
132,298 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DebugRecoveryProcessor.java | DebugRecoveryProcessor.create | public static DebugRecoveryProcessor create(int containerId, DurableDataLog durableDataLog, ContainerConfig config, ReadIndexConfig readIndexConfig,
ScheduledExecutorService executor, OperationCallbacks callbacks) {
Preconditions.checkNotNull(durableDataLog, "dura... | java | public static DebugRecoveryProcessor create(int containerId, DurableDataLog durableDataLog, ContainerConfig config, ReadIndexConfig readIndexConfig,
ScheduledExecutorService executor, OperationCallbacks callbacks) {
Preconditions.checkNotNull(durableDataLog, "dura... | [
"public",
"static",
"DebugRecoveryProcessor",
"create",
"(",
"int",
"containerId",
",",
"DurableDataLog",
"durableDataLog",
",",
"ContainerConfig",
"config",
",",
"ReadIndexConfig",
"readIndexConfig",
",",
"ScheduledExecutorService",
"executor",
",",
"OperationCallbacks",
"... | Creates a new instance of the DebugRecoveryProcessor class with the given arguments.
@param containerId The Id of the Container to recover.
@param durableDataLog A DurableDataLog to recover from.
@param config A ContainerConfig to use during recovery.
@param readIndexConfig A ReadIndexConfig to use durin... | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"DebugRecoveryProcessor",
"class",
"with",
"the",
"given",
"arguments",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DebugRecoveryProcessor.java#L82-L96 |
132,299 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DebugRecoveryProcessor.java | DebugRecoveryProcessor.recoverOperation | @Override
protected void recoverOperation(DataFrameRecord<Operation> dataFrameRecord, OperationMetadataUpdater metadataUpdater) throws DataCorruptionException {
if (this.callbacks.beginRecoverOperation != null) {
Callbacks.invokeSafely(this.callbacks.beginRecoverOperation, dataFrameRecord.getIte... | java | @Override
protected void recoverOperation(DataFrameRecord<Operation> dataFrameRecord, OperationMetadataUpdater metadataUpdater) throws DataCorruptionException {
if (this.callbacks.beginRecoverOperation != null) {
Callbacks.invokeSafely(this.callbacks.beginRecoverOperation, dataFrameRecord.getIte... | [
"@",
"Override",
"protected",
"void",
"recoverOperation",
"(",
"DataFrameRecord",
"<",
"Operation",
">",
"dataFrameRecord",
",",
"OperationMetadataUpdater",
"metadataUpdater",
")",
"throws",
"DataCorruptionException",
"{",
"if",
"(",
"this",
".",
"callbacks",
".",
"be... | region RecoveryProcessor Overrides | [
"region",
"RecoveryProcessor",
"Overrides"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DebugRecoveryProcessor.java#L102-L121 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.