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,100
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/records/RetentionSet.java
RetentionSet.findStreamCutReferenceForTime
public StreamCutReferenceRecord findStreamCutReferenceForTime(long time) { int beforeIndex = getGreatestLowerBound(this, time, StreamCutReferenceRecord::getRecordingTime); if (beforeIndex < 0) { return null; } return retentionRecords.get(beforeIndex); }
java
public StreamCutReferenceRecord findStreamCutReferenceForTime(long time) { int beforeIndex = getGreatestLowerBound(this, time, StreamCutReferenceRecord::getRecordingTime); if (beforeIndex < 0) { return null; } return retentionRecords.get(beforeIndex); }
[ "public", "StreamCutReferenceRecord", "findStreamCutReferenceForTime", "(", "long", "time", ")", "{", "int", "beforeIndex", "=", "getGreatestLowerBound", "(", "this", ",", "time", ",", "StreamCutReferenceRecord", "::", "getRecordingTime", ")", ";", "if", "(", "beforeI...
Find retention record on or before the given time. @param time time @return reference record which is greatest lower bound for given time. It returns null if no such record exists in the set.
[ "Find", "retention", "record", "on", "or", "before", "the", "given", "time", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RetentionSet.java#L68-L75
132,101
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/records/RetentionSet.java
RetentionSet.findStreamCutReferenceForSize
public StreamCutReferenceRecord findStreamCutReferenceForSize(long size) { int beforeIndex = getGreatestLowerBound(this, size, StreamCutReferenceRecord::getRecordingSize); if (beforeIndex < 0) { return null; } return retentionRecords.get(beforeIndex); }
java
public StreamCutReferenceRecord findStreamCutReferenceForSize(long size) { int beforeIndex = getGreatestLowerBound(this, size, StreamCutReferenceRecord::getRecordingSize); if (beforeIndex < 0) { return null; } return retentionRecords.get(beforeIndex); }
[ "public", "StreamCutReferenceRecord", "findStreamCutReferenceForSize", "(", "long", "size", ")", "{", "int", "beforeIndex", "=", "getGreatestLowerBound", "(", "this", ",", "size", ",", "StreamCutReferenceRecord", "::", "getRecordingSize", ")", ";", "if", "(", "beforeI...
Find retention record on or before the given size. @param size size @return reference record which is greatest lower bound for given size. It returns null if no such record exists in the set.
[ "Find", "retention", "record", "on", "or", "before", "the", "given", "size", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RetentionSet.java#L82-L89
132,102
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/records/RetentionSet.java
RetentionSet.removeStreamCutBefore
public static RetentionSet removeStreamCutBefore(RetentionSet set, StreamCutReferenceRecord record) { Preconditions.checkNotNull(record); // remove all stream cuts with recordingTime before supplied cut int beforeIndex = getGreatestLowerBound(set, record.getRecordingTime(), StreamCutReferenceRec...
java
public static RetentionSet removeStreamCutBefore(RetentionSet set, StreamCutReferenceRecord record) { Preconditions.checkNotNull(record); // remove all stream cuts with recordingTime before supplied cut int beforeIndex = getGreatestLowerBound(set, record.getRecordingTime(), StreamCutReferenceRec...
[ "public", "static", "RetentionSet", "removeStreamCutBefore", "(", "RetentionSet", "set", ",", "StreamCutReferenceRecord", "record", ")", "{", "Preconditions", ".", "checkNotNull", "(", "record", ")", ";", "// remove all stream cuts with recordingTime before supplied cut", "in...
Creates a new retention set object by removing all records on or before given record. @param set retention set to update @param record reference record @return updated retention set record after removing all elements before given reference record.
[ "Creates", "a", "new", "retention", "set", "object", "by", "removing", "all", "records", "on", "or", "before", "given", "record", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RetentionSet.java#L109-L122
132,103
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/TableMetadataStore.java
TableMetadataStore.initialize
@Override public CompletableFuture<Void> initialize(Duration timeout) { Preconditions.checkState(!this.initialized.get(), "TableMetadataStore is already initialized."); // Invoke submitAssignment(), which will ensure that the Metadata Segment is mapped in memory and pinned. // If this is th...
java
@Override public CompletableFuture<Void> initialize(Duration timeout) { Preconditions.checkState(!this.initialized.get(), "TableMetadataStore is already initialized."); // Invoke submitAssignment(), which will ensure that the Metadata Segment is mapped in memory and pinned. // If this is th...
[ "@", "Override", "public", "CompletableFuture", "<", "Void", ">", "initialize", "(", "Duration", "timeout", ")", "{", "Preconditions", ".", "checkState", "(", "!", "this", ".", "initialized", ".", "get", "(", ")", ",", "\"TableMetadataStore is already initialized....
region MetadataStore Implementation
[ "region", "MetadataStore", "Implementation" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/TableMetadataStore.java#L74-L90
132,104
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java
IndexWriter.updateBuckets
CompletableFuture<Integer> updateBuckets(DirectSegmentAccess segment, Collection<BucketUpdate> bucketUpdates, long firstIndexedOffset, long lastIndexedOffset, int processedCount, Duration timeout) { UpdateInstructions update = new UpdateInstructions(); // Pr...
java
CompletableFuture<Integer> updateBuckets(DirectSegmentAccess segment, Collection<BucketUpdate> bucketUpdates, long firstIndexedOffset, long lastIndexedOffset, int processedCount, Duration timeout) { UpdateInstructions update = new UpdateInstructions(); // Pr...
[ "CompletableFuture", "<", "Integer", ">", "updateBuckets", "(", "DirectSegmentAccess", "segment", ",", "Collection", "<", "BucketUpdate", ">", "bucketUpdates", ",", "long", "firstIndexedOffset", ",", "long", "lastIndexedOffset", ",", "int", "processedCount", ",", "Dur...
Determines what Segment Attribute Updates are necessary to apply the given bucket updates and executes them onto the given Segment. @param segment A {@link DirectSegmentAccess} representing the Segment to apply the updates to. @param bucketUpdates A Collection of {@link BucketUpdate} instances to apply...
[ "Determines", "what", "Segment", "Attribute", "Updates", "are", "necessary", "to", "apply", "the", "given", "bucket", "updates", "and", "executes", "them", "onto", "the", "given", "Segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java#L113-L139
132,105
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java
IndexWriter.generateBackpointerUpdate
private AttributeUpdate generateBackpointerUpdate(long fromOffset, long toOffset) { return new AttributeUpdate(getBackpointerAttributeKey(fromOffset), AttributeUpdateType.Replace, toOffset); }
java
private AttributeUpdate generateBackpointerUpdate(long fromOffset, long toOffset) { return new AttributeUpdate(getBackpointerAttributeKey(fromOffset), AttributeUpdateType.Replace, toOffset); }
[ "private", "AttributeUpdate", "generateBackpointerUpdate", "(", "long", "fromOffset", ",", "long", "toOffset", ")", "{", "return", "new", "AttributeUpdate", "(", "getBackpointerAttributeKey", "(", "fromOffset", ")", ",", "AttributeUpdateType", ".", "Replace", ",", "to...
Generates an AttributeUpdate that creates a new or updates an existing Backpointer. @param fromOffset The offset at which the Backpointer originates. @param toOffset The offset at which the Backpointer ends.
[ "Generates", "an", "AttributeUpdate", "that", "creates", "a", "new", "or", "updates", "an", "existing", "Backpointer", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java#L315-L317
132,106
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java
IndexWriter.generateBackpointerRemoval
private AttributeUpdate generateBackpointerRemoval(long fromOffset) { return new AttributeUpdate(getBackpointerAttributeKey(fromOffset), AttributeUpdateType.Replace, Attributes.NULL_ATTRIBUTE_VALUE); }
java
private AttributeUpdate generateBackpointerRemoval(long fromOffset) { return new AttributeUpdate(getBackpointerAttributeKey(fromOffset), AttributeUpdateType.Replace, Attributes.NULL_ATTRIBUTE_VALUE); }
[ "private", "AttributeUpdate", "generateBackpointerRemoval", "(", "long", "fromOffset", ")", "{", "return", "new", "AttributeUpdate", "(", "getBackpointerAttributeKey", "(", "fromOffset", ")", ",", "AttributeUpdateType", ".", "Replace", ",", "Attributes", ".", "NULL_ATTR...
Generates an AttributeUpdate that removes a Backpointer, whether it exists or not. @param fromOffset The offset at which the Backpointer originates.
[ "Generates", "an", "AttributeUpdate", "that", "removes", "a", "Backpointer", "whether", "it", "exists", "or", "not", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java#L324-L326
132,107
pravega/pravega
controller/src/main/java/io/pravega/controller/store/host/ZKHostStore.java
ZKHostStore.tryInit
@Synchronized @SneakyThrows(Exception.class) private void tryInit() { if (!zkInit) { // we are making remote calls under a lock but this is only done for initialization at // the start of controller process. ZKUtils.createPathIfNotExists(zkClient, zkPath, HostContain...
java
@Synchronized @SneakyThrows(Exception.class) private void tryInit() { if (!zkInit) { // we are making remote calls under a lock but this is only done for initialization at // the start of controller process. ZKUtils.createPathIfNotExists(zkClient, zkPath, HostContain...
[ "@", "Synchronized", "@", "SneakyThrows", "(", "Exception", ".", "class", ")", "private", "void", "tryInit", "(", ")", "{", "if", "(", "!", "zkInit", ")", "{", "// we are making remote calls under a lock but this is only done for initialization at ", "// the start of cont...
Ensure required zk node is present in zookeeper.
[ "Ensure", "required", "zk", "node", "is", "present", "in", "zookeeper", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/host/ZKHostStore.java#L77-L89
132,108
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadResultEntryBase.java
ReadResultEntryBase.complete
protected void complete(ReadResultEntryContents readResultEntryContents) { Preconditions.checkState(!this.contents.isDone(), "ReadResultEntry has already had its result set."); CompletionConsumer callback = this.completionCallback; if (callback != null) { callback.accept(readResultEn...
java
protected void complete(ReadResultEntryContents readResultEntryContents) { Preconditions.checkState(!this.contents.isDone(), "ReadResultEntry has already had its result set."); CompletionConsumer callback = this.completionCallback; if (callback != null) { callback.accept(readResultEn...
[ "protected", "void", "complete", "(", "ReadResultEntryContents", "readResultEntryContents", ")", "{", "Preconditions", ".", "checkState", "(", "!", "this", ".", "contents", ".", "isDone", "(", ")", ",", "\"ReadResultEntry has already had its result set.\"", ")", ";", ...
Completes the Future of this ReadResultEntry by setting the given content. @param readResultEntryContents The content to set.
[ "Completes", "the", "Future", "of", "this", "ReadResultEntry", "by", "setting", "the", "given", "content", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadResultEntryBase.java#L104-L112
132,109
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadResultEntryBase.java
ReadResultEntryBase.fail
protected void fail(Throwable exception) { Preconditions.checkState(!this.contents.isDone(), "ReadResultEntry has already had its result set."); this.contents.completeExceptionally(exception); }
java
protected void fail(Throwable exception) { Preconditions.checkState(!this.contents.isDone(), "ReadResultEntry has already had its result set."); this.contents.completeExceptionally(exception); }
[ "protected", "void", "fail", "(", "Throwable", "exception", ")", "{", "Preconditions", ".", "checkState", "(", "!", "this", ".", "contents", ".", "isDone", "(", ")", ",", "\"ReadResultEntry has already had its result set.\"", ")", ";", "this", ".", "contents", "...
Fails the Future of this ReadResultEntry with the given exception. @param exception The exception to set.
[ "Fails", "the", "Future", "of", "this", "ReadResultEntry", "with", "the", "given", "exception", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadResultEntryBase.java#L119-L122
132,110
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogReader.java
LogReader.getNext
@Override public DurableDataLog.ReadItem getNext() throws DurableDataLogException { Exceptions.checkNotClosed(this.closed.get(), this); if (this.currentLedger == null) { // First time we call this. Locate the first ledger based on the metadata truncation address. We don't know ...
java
@Override public DurableDataLog.ReadItem getNext() throws DurableDataLogException { Exceptions.checkNotClosed(this.closed.get(), this); if (this.currentLedger == null) { // First time we call this. Locate the first ledger based on the metadata truncation address. We don't know ...
[ "@", "Override", "public", "DurableDataLog", ".", "ReadItem", "getNext", "(", ")", "throws", "DurableDataLogException", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ".", "get", "(", ")", ",", "this", ")", ";", "if", "(", "this", "....
region CloseableIterator Implementation
[ "region", "CloseableIterator", "Implementation" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogReader.java#L86-L109
132,111
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.writeShort
public static int writeShort(ArrayView target, int offset, short value) { return writeShort(target.array(), target.arrayOffset() + offset, value); }
java
public static int writeShort(ArrayView target, int offset, short value) { return writeShort(target.array(), target.arrayOffset() + offset, value); }
[ "public", "static", "int", "writeShort", "(", "ArrayView", "target", ",", "int", "offset", ",", "short", "value", ")", "{", "return", "writeShort", "(", "target", ".", "array", "(", ")", ",", "target", ".", "arrayOffset", "(", ")", "+", "offset", ",", ...
Writes the given 16-bit Short to the given ArrayView at the given offset. @param target The ArrayView to write to. @param offset The offset within the ArrayView to write at. @param value The value to write. @return The number of bytes written.
[ "Writes", "the", "given", "16", "-", "bit", "Short", "to", "the", "given", "ArrayView", "at", "the", "given", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L30-L32
132,112
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.writeShort
public static int writeShort(byte[] target, int offset, short value) { target[offset] = (byte) (value >>> 8 & 255); target[offset + 1] = (byte) (value & 255); return Short.BYTES; }
java
public static int writeShort(byte[] target, int offset, short value) { target[offset] = (byte) (value >>> 8 & 255); target[offset + 1] = (byte) (value & 255); return Short.BYTES; }
[ "public", "static", "int", "writeShort", "(", "byte", "[", "]", "target", ",", "int", "offset", ",", "short", "value", ")", "{", "target", "[", "offset", "]", "=", "(", "byte", ")", "(", "value", ">>>", "8", "&", "255", ")", ";", "target", "[", "...
Writes the given 16-bit Short to the given byte array at the given offset. @param target The byte array to write to. @param offset The offset within the byte array to write at. @param value The value to write. @return The number of bytes written.
[ "Writes", "the", "given", "16", "-", "bit", "Short", "to", "the", "given", "byte", "array", "at", "the", "given", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L42-L46
132,113
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.writeInt
public static int writeInt(ArrayView target, int offset, int value) { return writeInt(target.array(), target.arrayOffset() + offset, value); }
java
public static int writeInt(ArrayView target, int offset, int value) { return writeInt(target.array(), target.arrayOffset() + offset, value); }
[ "public", "static", "int", "writeInt", "(", "ArrayView", "target", ",", "int", "offset", ",", "int", "value", ")", "{", "return", "writeInt", "(", "target", ".", "array", "(", ")", ",", "target", ".", "arrayOffset", "(", ")", "+", "offset", ",", "value...
Writes the given 32-bit Integer to the given ArrayView at the given offset. @param target The ArrayView to write to. @param offset The offset within the ArrayView to write at. @param value The value to write. @return The number of bytes written.
[ "Writes", "the", "given", "32", "-", "bit", "Integer", "to", "the", "given", "ArrayView", "at", "the", "given", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L56-L58
132,114
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.writeInt
public static int writeInt(byte[] target, int offset, int value) { target[offset] = (byte) (value >>> 24); target[offset + 1] = (byte) (value >>> 16); target[offset + 2] = (byte) (value >>> 8); target[offset + 3] = (byte) value; return Integer.BYTES; }
java
public static int writeInt(byte[] target, int offset, int value) { target[offset] = (byte) (value >>> 24); target[offset + 1] = (byte) (value >>> 16); target[offset + 2] = (byte) (value >>> 8); target[offset + 3] = (byte) value; return Integer.BYTES; }
[ "public", "static", "int", "writeInt", "(", "byte", "[", "]", "target", ",", "int", "offset", ",", "int", "value", ")", "{", "target", "[", "offset", "]", "=", "(", "byte", ")", "(", "value", ">>>", "24", ")", ";", "target", "[", "offset", "+", "...
Writes the given 32-bit Integer to the given byte array at the given offset. @param target The byte array to write to. @param offset The offset within the byte array to write at. @param value The value to write. @return The number of bytes written.
[ "Writes", "the", "given", "32", "-", "bit", "Integer", "to", "the", "given", "byte", "array", "at", "the", "given", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L68-L74
132,115
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.writeInt
public static int writeInt(OutputStream target, int value) throws IOException { target.write(value >>> 24); target.write(value >>> 16); target.write(value >>> 8); target.write(value); return Integer.BYTES; }
java
public static int writeInt(OutputStream target, int value) throws IOException { target.write(value >>> 24); target.write(value >>> 16); target.write(value >>> 8); target.write(value); return Integer.BYTES; }
[ "public", "static", "int", "writeInt", "(", "OutputStream", "target", ",", "int", "value", ")", "throws", "IOException", "{", "target", ".", "write", "(", "value", ">>>", "24", ")", ";", "target", ".", "write", "(", "value", ">>>", "16", ")", ";", "tar...
Writes the given 32-bit Integer to the given OutputStream. @param target The OutputStream to write to. @param value The value to write. @return The number of bytes written. @throws IOException If an exception got thrown.
[ "Writes", "the", "given", "32", "-", "bit", "Integer", "to", "the", "given", "OutputStream", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L84-L90
132,116
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.readShort
public static short readShort(ArrayView source, int position) { return (short) ((source.get(position) & 0xFF) << 8 | (source.get(position + 1) & 0xFF)); }
java
public static short readShort(ArrayView source, int position) { return (short) ((source.get(position) & 0xFF) << 8 | (source.get(position + 1) & 0xFF)); }
[ "public", "static", "short", "readShort", "(", "ArrayView", "source", ",", "int", "position", ")", "{", "return", "(", "short", ")", "(", "(", "source", ".", "get", "(", "position", ")", "&", "0xFF", ")", "<<", "8", "|", "(", "source", ".", "get", ...
Reads a 16-bit Short from the given ArrayView starting at the given position. @param source The ArrayView to read from. @param position The position in the ArrayView to start reading at. @return The read number.
[ "Reads", "a", "16", "-", "bit", "Short", "from", "the", "given", "ArrayView", "starting", "at", "the", "given", "position", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L111-L114
132,117
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.readInt
public static int readInt(byte[] source, int position) { return (source[position] & 0xFF) << 24 | (source[position + 1] & 0xFF) << 16 | (source[position + 2] & 0xFF) << 8 | (source[position + 3] & 0xFF); }
java
public static int readInt(byte[] source, int position) { return (source[position] & 0xFF) << 24 | (source[position + 1] & 0xFF) << 16 | (source[position + 2] & 0xFF) << 8 | (source[position + 3] & 0xFF); }
[ "public", "static", "int", "readInt", "(", "byte", "[", "]", "source", ",", "int", "position", ")", "{", "return", "(", "source", "[", "position", "]", "&", "0xFF", ")", "<<", "24", "|", "(", "source", "[", "position", "+", "1", "]", "&", "0xFF", ...
Reads a 32-bit integer from the given byte array starting at the given position. @param source The byte array to read from. @param position The position in the byte array to start reading at. @return The read number.
[ "Reads", "a", "32", "-", "bit", "integer", "from", "the", "given", "byte", "array", "starting", "at", "the", "given", "position", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L123-L128
132,118
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.readInt
public static int readInt(ArrayView source, int position) { return (source.get(position) & 0xFF) << 24 | (source.get(position + 1) & 0xFF) << 16 | (source.get(position + 2) & 0xFF) << 8 | (source.get(position + 3) & 0xFF); }
java
public static int readInt(ArrayView source, int position) { return (source.get(position) & 0xFF) << 24 | (source.get(position + 1) & 0xFF) << 16 | (source.get(position + 2) & 0xFF) << 8 | (source.get(position + 3) & 0xFF); }
[ "public", "static", "int", "readInt", "(", "ArrayView", "source", ",", "int", "position", ")", "{", "return", "(", "source", ".", "get", "(", "position", ")", "&", "0xFF", ")", "<<", "24", "|", "(", "source", ".", "get", "(", "position", "+", "1", ...
Reads a 32-bit integer from the given ArrayView starting at the given position. @param source The ArrayView to read from. @param position The position in the ArrayView to start reading at. @return The read number.
[ "Reads", "a", "32", "-", "bit", "integer", "from", "the", "given", "ArrayView", "starting", "at", "the", "given", "position", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L137-L142
132,119
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.readInt
public static int readInt(InputStream source) throws IOException { int b1 = source.read(); int b2 = source.read(); int b3 = source.read(); int b4 = source.read(); if ((b1 | b2 | b3 | b4) < 0) { throw new EOFException(); } else { return (b1 << 24) +...
java
public static int readInt(InputStream source) throws IOException { int b1 = source.read(); int b2 = source.read(); int b3 = source.read(); int b4 = source.read(); if ((b1 | b2 | b3 | b4) < 0) { throw new EOFException(); } else { return (b1 << 24) +...
[ "public", "static", "int", "readInt", "(", "InputStream", "source", ")", "throws", "IOException", "{", "int", "b1", "=", "source", ".", "read", "(", ")", ";", "int", "b2", "=", "source", ".", "read", "(", ")", ";", "int", "b3", "=", "source", ".", ...
Reads a 32-bit integer from the given InputStream that was encoded using BitConverter.writeInt. @param source The InputStream to read from. @return The read number. @throws IOException If an exception got thrown.
[ "Reads", "a", "32", "-", "bit", "integer", "from", "the", "given", "InputStream", "that", "was", "encoded", "using", "BitConverter", ".", "writeInt", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L151-L161
132,120
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.writeLong
public static int writeLong(ArrayView target, int offset, long value) { return writeLong(target.array(), target.arrayOffset() + offset, value); }
java
public static int writeLong(ArrayView target, int offset, long value) { return writeLong(target.array(), target.arrayOffset() + offset, value); }
[ "public", "static", "int", "writeLong", "(", "ArrayView", "target", ",", "int", "offset", ",", "long", "value", ")", "{", "return", "writeLong", "(", "target", ".", "array", "(", ")", ",", "target", ".", "arrayOffset", "(", ")", "+", "offset", ",", "va...
Writes the given 64-bit Long to the given ArrayView at the given offset. @param target The ArrayView to write to. @param offset The offset within the ArrayView to write at. @param value The value to write. @return The number of bytes written.
[ "Writes", "the", "given", "64", "-", "bit", "Long", "to", "the", "given", "ArrayView", "at", "the", "given", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L171-L173
132,121
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.writeLong
public static int writeLong(byte[] target, int offset, long value) { target[offset] = (byte) (value >>> 56); target[offset + 1] = (byte) (value >>> 48); target[offset + 2] = (byte) (value >>> 40); target[offset + 3] = (byte) (value >>> 32); target[offset + 4] = (byte) (value >>> ...
java
public static int writeLong(byte[] target, int offset, long value) { target[offset] = (byte) (value >>> 56); target[offset + 1] = (byte) (value >>> 48); target[offset + 2] = (byte) (value >>> 40); target[offset + 3] = (byte) (value >>> 32); target[offset + 4] = (byte) (value >>> ...
[ "public", "static", "int", "writeLong", "(", "byte", "[", "]", "target", ",", "int", "offset", ",", "long", "value", ")", "{", "target", "[", "offset", "]", "=", "(", "byte", ")", "(", "value", ">>>", "56", ")", ";", "target", "[", "offset", "+", ...
Writes the given 64-bit Long to the given byte array at the given offset. @param target The byte array to write to. @param offset The offset within the byte array to write at. @param value The value to write. @return The number of bytes written.
[ "Writes", "the", "given", "64", "-", "bit", "Long", "to", "the", "given", "byte", "array", "at", "the", "given", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L183-L193
132,122
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.writeUUID
public static int writeUUID(byte[] target, int offset, UUID value) { writeLong(target, offset, value.getMostSignificantBits()); writeLong(target, offset + Long.BYTES, value.getLeastSignificantBits()); return 2 * Long.BYTES; }
java
public static int writeUUID(byte[] target, int offset, UUID value) { writeLong(target, offset, value.getMostSignificantBits()); writeLong(target, offset + Long.BYTES, value.getLeastSignificantBits()); return 2 * Long.BYTES; }
[ "public", "static", "int", "writeUUID", "(", "byte", "[", "]", "target", ",", "int", "offset", ",", "UUID", "value", ")", "{", "writeLong", "(", "target", ",", "offset", ",", "value", ".", "getMostSignificantBits", "(", ")", ")", ";", "writeLong", "(", ...
Writes the given 128-bit UUID to the given byte array at the given offset. @param target The byte array to write to. @param offset The offset within the byte array to write at. @param value The value to write. @return The number of bytes written.
[ "Writes", "the", "given", "128", "-", "bit", "UUID", "to", "the", "given", "byte", "array", "at", "the", "given", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L203-L207
132,123
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.readUUID
public static UUID readUUID(ArrayView source, int position) { long msb = readLong(source, position); long lsb = readLong(source, position + Long.BYTES); return new UUID(msb, lsb); }
java
public static UUID readUUID(ArrayView source, int position) { long msb = readLong(source, position); long lsb = readLong(source, position + Long.BYTES); return new UUID(msb, lsb); }
[ "public", "static", "UUID", "readUUID", "(", "ArrayView", "source", ",", "int", "position", ")", "{", "long", "msb", "=", "readLong", "(", "source", ",", "position", ")", ";", "long", "lsb", "=", "readLong", "(", "source", ",", "position", "+", "Long", ...
Reads a 128-bit UUID from the given ArrayView starting at the given position. @param source The ArrayView to read from. @param position The position in the ArrayView to start reading at. @return The read UUID.
[ "Reads", "a", "128", "-", "bit", "UUID", "from", "the", "given", "ArrayView", "starting", "at", "the", "given", "position", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L216-L220
132,124
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.readLong
public static long readLong(ArrayView source, int position) { return (long) (source.get(position) & 0xFF) << 56 | (long) (source.get(position + 1) & 0xFF) << 48 | (long) (source.get(position + 2) & 0xFF) << 40 | (long) (source.get(position + 3) & 0xFF) << 32 ...
java
public static long readLong(ArrayView source, int position) { return (long) (source.get(position) & 0xFF) << 56 | (long) (source.get(position + 1) & 0xFF) << 48 | (long) (source.get(position + 2) & 0xFF) << 40 | (long) (source.get(position + 3) & 0xFF) << 32 ...
[ "public", "static", "long", "readLong", "(", "ArrayView", "source", ",", "int", "position", ")", "{", "return", "(", "long", ")", "(", "source", ".", "get", "(", "position", ")", "&", "0xFF", ")", "<<", "56", "|", "(", "long", ")", "(", "source", "...
Reads a 64-bit long from the given ArrayView starting at the given position. @param source The ArrayView to read from. @param position The position in the ArrayView to start reading at. @return The read number.
[ "Reads", "a", "64", "-", "bit", "long", "from", "the", "given", "ArrayView", "starting", "at", "the", "given", "position", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L242-L251
132,125
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.readLong
public static long readLong(byte[] source, int position) { return (long) (source[position] & 0xFF) << 56 | (long) (source[position + 1] & 0xFF) << 48 | (long) (source[position + 2] & 0xFF) << 40 | (long) (source[position + 3] & 0xFF) << 32 | (long)...
java
public static long readLong(byte[] source, int position) { return (long) (source[position] & 0xFF) << 56 | (long) (source[position + 1] & 0xFF) << 48 | (long) (source[position + 2] & 0xFF) << 40 | (long) (source[position + 3] & 0xFF) << 32 | (long)...
[ "public", "static", "long", "readLong", "(", "byte", "[", "]", "source", ",", "int", "position", ")", "{", "return", "(", "long", ")", "(", "source", "[", "position", "]", "&", "0xFF", ")", "<<", "56", "|", "(", "long", ")", "(", "source", "[", "...
Reads a 64-bit long from the given byte array starting at the given position. @param source The byte array to read from. @param position The position in the byte array to start reading at. @return The read number.
[ "Reads", "a", "64", "-", "bit", "long", "from", "the", "given", "byte", "array", "starting", "at", "the", "given", "position", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L260-L269
132,126
pravega/pravega
common/src/main/java/io/pravega/common/util/BitConverter.java
BitConverter.readLong
public static long readLong(InputStream source) throws IOException { int b1 = source.read(); int b2 = source.read(); int b3 = source.read(); int b4 = source.read(); int b5 = source.read(); int b6 = source.read(); int b7 = source.read(); int b8 = source.rea...
java
public static long readLong(InputStream source) throws IOException { int b1 = source.read(); int b2 = source.read(); int b3 = source.read(); int b4 = source.read(); int b5 = source.read(); int b6 = source.read(); int b7 = source.read(); int b8 = source.rea...
[ "public", "static", "long", "readLong", "(", "InputStream", "source", ")", "throws", "IOException", "{", "int", "b1", "=", "source", ".", "read", "(", ")", ";", "int", "b2", "=", "source", ".", "read", "(", ")", ";", "int", "b3", "=", "source", ".", ...
Reads a 64-bit long from the given InputStream that was encoded using BitConverter.writeLong. @param source The InputStream to read from. @return The read number. @throws IOException If an exception got thrown.
[ "Reads", "a", "64", "-", "bit", "long", "from", "the", "given", "InputStream", "that", "was", "encoded", "using", "BitConverter", ".", "writeLong", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L278-L299
132,127
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java
LogMetadata.addLedger
LogMetadata addLedger(long ledgerId) { Preconditions.checkState(this.enabled, "Log is not enabled. Cannot perform any modifications on it."); // Copy existing ledgers. List<LedgerMetadata> newLedgers = new ArrayList<>(this.ledgers.size() + 1); newLedgers.addAll(this.ledgers); /...
java
LogMetadata addLedger(long ledgerId) { Preconditions.checkState(this.enabled, "Log is not enabled. Cannot perform any modifications on it."); // Copy existing ledgers. List<LedgerMetadata> newLedgers = new ArrayList<>(this.ledgers.size() + 1); newLedgers.addAll(this.ledgers); /...
[ "LogMetadata", "addLedger", "(", "long", "ledgerId", ")", "{", "Preconditions", ".", "checkState", "(", "this", ".", "enabled", ",", "\"Log is not enabled. Cannot perform any modifications on it.\"", ")", ";", "// Copy existing ledgers.", "List", "<", "LedgerMetadata", ">...
Creates a new instance of the LogMetadata class which contains an additional ledger. @param ledgerId The Id of the Ledger to add. @return A new instance of the LogMetadata class.
[ "Creates", "a", "new", "instance", "of", "the", "LogMetadata", "class", "which", "contains", "an", "additional", "ledger", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L130-L141
132,128
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java
LogMetadata.removeEmptyLedgers
LogMetadata removeEmptyLedgers(int skipCountFromEnd) { val newLedgers = new ArrayList<LedgerMetadata>(); int cutoffIndex = this.ledgers.size() - skipCountFromEnd; for (int i = 0; i < cutoffIndex; i++) { LedgerMetadata lm = this.ledgers.get(i); if (lm.getStatus() != Ledger...
java
LogMetadata removeEmptyLedgers(int skipCountFromEnd) { val newLedgers = new ArrayList<LedgerMetadata>(); int cutoffIndex = this.ledgers.size() - skipCountFromEnd; for (int i = 0; i < cutoffIndex; i++) { LedgerMetadata lm = this.ledgers.get(i); if (lm.getStatus() != Ledger...
[ "LogMetadata", "removeEmptyLedgers", "(", "int", "skipCountFromEnd", ")", "{", "val", "newLedgers", "=", "new", "ArrayList", "<", "LedgerMetadata", ">", "(", ")", ";", "int", "cutoffIndex", "=", "this", ".", "ledgers", ".", "size", "(", ")", "-", "skipCountF...
Removes LedgerMetadata instances for those Ledgers that are known to be empty. @param skipCountFromEnd The number of Ledgers to spare, counting from the end of the LedgerMetadata list. @return A new instance of LogMetadata with the updated ledger list.
[ "Removes", "LedgerMetadata", "instances", "for", "those", "Ledgers", "that", "are", "known", "to", "be", "empty", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L165-L182
132,129
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java
LogMetadata.updateLedgerStatus
LogMetadata updateLedgerStatus(Map<Long, Long> lastAddConfirmed) { if (lastAddConfirmed.isEmpty()) { // Nothing to change. return this; } val newLedgers = this.ledgers.stream() .map(lm -> { long lac = lastAddConfirmed.getOrDefault(lm.g...
java
LogMetadata updateLedgerStatus(Map<Long, Long> lastAddConfirmed) { if (lastAddConfirmed.isEmpty()) { // Nothing to change. return this; } val newLedgers = this.ledgers.stream() .map(lm -> { long lac = lastAddConfirmed.getOrDefault(lm.g...
[ "LogMetadata", "updateLedgerStatus", "(", "Map", "<", "Long", ",", "Long", ">", "lastAddConfirmed", ")", "{", "if", "(", "lastAddConfirmed", ".", "isEmpty", "(", ")", ")", "{", "// Nothing to change.", "return", "this", ";", "}", "val", "newLedgers", "=", "t...
Updates the LastAddConfirmed on individual LedgerMetadata instances based on the provided argument. @param lastAddConfirmed A Map of LedgerId to LastAddConfirmed based on which we can update the status. @return This (unmodified) instance if lastAddConfirmed.isEmpty() or a new instance of the LogMetadata class with the...
[ "Updates", "the", "LastAddConfirmed", "on", "individual", "LedgerMetadata", "instances", "based", "on", "the", "provided", "argument", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L191-L211
132,130
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java
LogMetadata.withUpdateVersion
LogMetadata withUpdateVersion(int value) { Preconditions.checkArgument(value >= this.updateVersion.get(), "versions must increase"); this.updateVersion.set(value); return this; }
java
LogMetadata withUpdateVersion(int value) { Preconditions.checkArgument(value >= this.updateVersion.get(), "versions must increase"); this.updateVersion.set(value); return this; }
[ "LogMetadata", "withUpdateVersion", "(", "int", "value", ")", "{", "Preconditions", ".", "checkArgument", "(", "value", ">=", "this", ".", "updateVersion", ".", "get", "(", ")", ",", "\"versions must increase\"", ")", ";", "this", ".", "updateVersion", ".", "s...
Updates the current version of the metadata. @param value The new metadata version. @return This instance.
[ "Updates", "the", "current", "version", "of", "the", "metadata", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L230-L234
132,131
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java
LogMetadata.asEnabled
LogMetadata asEnabled() { return this.enabled ? this : new LogMetadata(this.epoch, true, this.ledgers, this.truncationAddress, this.updateVersion.get()); }
java
LogMetadata asEnabled() { return this.enabled ? this : new LogMetadata(this.epoch, true, this.ledgers, this.truncationAddress, this.updateVersion.get()); }
[ "LogMetadata", "asEnabled", "(", ")", "{", "return", "this", ".", "enabled", "?", "this", ":", "new", "LogMetadata", "(", "this", ".", "epoch", ",", "true", ",", "this", ".", "ledgers", ",", "this", ".", "truncationAddress", ",", "this", ".", "updateVers...
Returns a LogMetadata class with the exact contents of this instance, but the enabled flag set to true. No changes are performed on this instance. @return This instance, if isEnabled() == true, of a new instance of the LogMetadata class which will have isEnabled() == true, otherwise.
[ "Returns", "a", "LogMetadata", "class", "with", "the", "exact", "contents", "of", "this", "instance", "but", "the", "enabled", "flag", "set", "to", "true", ".", "No", "changes", "are", "performed", "on", "this", "instance", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L243-L245
132,132
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java
LogMetadata.asDisabled
LogMetadata asDisabled() { return this.enabled ? new LogMetadata(this.epoch, false, this.ledgers, this.truncationAddress, this.updateVersion.get()) : this; }
java
LogMetadata asDisabled() { return this.enabled ? new LogMetadata(this.epoch, false, this.ledgers, this.truncationAddress, this.updateVersion.get()) : this; }
[ "LogMetadata", "asDisabled", "(", ")", "{", "return", "this", ".", "enabled", "?", "new", "LogMetadata", "(", "this", ".", "epoch", ",", "false", ",", "this", ".", "ledgers", ",", "this", ".", "truncationAddress", ",", "this", ".", "updateVersion", ".", ...
Returns a LogMetadata class with the exact contents of this instance, but the enabled flag set to false. No changes are performed on this instance. @return This instance, if isEnabled() == false, of a new instance of the LogMetadata class which will have isEnabled() == false, otherwise.
[ "Returns", "a", "LogMetadata", "class", "with", "the", "exact", "contents", "of", "this", "instance", "but", "the", "enabled", "flag", "set", "to", "false", ".", "No", "changes", "are", "performed", "on", "this", "instance", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L254-L256
132,133
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java
LogMetadata.getLedger
LedgerMetadata getLedger(long ledgerId) { int index = getLedgerMetadataIndex(ledgerId); if (index >= 0) { return this.ledgers.get(index); } return null; }
java
LedgerMetadata getLedger(long ledgerId) { int index = getLedgerMetadataIndex(ledgerId); if (index >= 0) { return this.ledgers.get(index); } return null; }
[ "LedgerMetadata", "getLedger", "(", "long", "ledgerId", ")", "{", "int", "index", "=", "getLedgerMetadataIndex", "(", "ledgerId", ")", ";", "if", "(", "index", ">=", "0", ")", "{", "return", "this", ".", "ledgers", ".", "get", "(", "index", ")", ";", "...
Gets the LedgerMetadata for the ledger with given ledger Id. @param ledgerId The Ledger Id to search. @return The sought LedgerMetadata, or null if not found.
[ "Gets", "the", "LedgerMetadata", "for", "the", "ledger", "with", "given", "ledger", "Id", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L264-L271
132,134
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java
LogMetadata.getNextAddress
LedgerAddress getNextAddress(LedgerAddress address, long lastEntryId) { if (this.ledgers.size() == 0) { // Quick bail-out. Nothing to return. return null; } LedgerAddress result = null; LedgerMetadata firstLedger = this.ledgers.get(0); if (address.getLedg...
java
LedgerAddress getNextAddress(LedgerAddress address, long lastEntryId) { if (this.ledgers.size() == 0) { // Quick bail-out. Nothing to return. return null; } LedgerAddress result = null; LedgerMetadata firstLedger = this.ledgers.get(0); if (address.getLedg...
[ "LedgerAddress", "getNextAddress", "(", "LedgerAddress", "address", ",", "long", "lastEntryId", ")", "{", "if", "(", "this", ".", "ledgers", ".", "size", "(", ")", "==", "0", ")", "{", "// Quick bail-out. Nothing to return.", "return", "null", ";", "}", "Ledge...
Gets the Ledger Address immediately following the given address. @param address The current address. @param lastEntryId If known, then Entry Id of the last entry in the ledger to which address is pointing. This is used to determine if the next address should be returned on the next ledger. If not known, this shoul...
[ "Gets", "the", "Ledger", "Address", "immediately", "following", "the", "given", "address", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/LogMetadata.java#L282-L325
132,135
pravega/pravega
common/src/main/java/io/pravega/common/util/btree/UpdateablePageCollection.java
UpdateablePageCollection.remove
@Override synchronized void remove(PageWrapper page) { super.remove(page); if (this.incompleteNewPageOffset == page.getOffset()) { this.incompleteNewPageOffset = PagePointer.NO_OFFSET; } this.deletedPageOffsets.add(page.getOffset()); page.setOffset(PagePointer.NO...
java
@Override synchronized void remove(PageWrapper page) { super.remove(page); if (this.incompleteNewPageOffset == page.getOffset()) { this.incompleteNewPageOffset = PagePointer.NO_OFFSET; } this.deletedPageOffsets.add(page.getOffset()); page.setOffset(PagePointer.NO...
[ "@", "Override", "synchronized", "void", "remove", "(", "PageWrapper", "page", ")", "{", "super", ".", "remove", "(", "page", ")", ";", "if", "(", "this", ".", "incompleteNewPageOffset", "==", "page", ".", "getOffset", "(", ")", ")", "{", "this", ".", ...
Removes the given PageWrapper from this PageCollection. @param page The PageWrapper to remove. This page will have its offset set to PagePointer.NO_OFFSET.
[ "Removes", "the", "given", "PageWrapper", "from", "this", "PageCollection", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/UpdateablePageCollection.java#L76-L85
132,136
pravega/pravega
common/src/main/java/io/pravega/common/util/btree/UpdateablePageCollection.java
UpdateablePageCollection.complete
synchronized void complete(PageWrapper page) { Preconditions.checkArgument(this.pageByOffset.containsKey(page.getOffset()), "Given page is not registered."); Preconditions.checkArgument(this.incompleteNewPageOffset == PagePointer.NO_OFFSET || this.incompleteNewPageOffset == page.getOffset(), ...
java
synchronized void complete(PageWrapper page) { Preconditions.checkArgument(this.pageByOffset.containsKey(page.getOffset()), "Given page is not registered."); Preconditions.checkArgument(this.incompleteNewPageOffset == PagePointer.NO_OFFSET || this.incompleteNewPageOffset == page.getOffset(), ...
[ "synchronized", "void", "complete", "(", "PageWrapper", "page", ")", "{", "Preconditions", ".", "checkArgument", "(", "this", ".", "pageByOffset", ".", "containsKey", "(", "page", ".", "getOffset", "(", ")", ")", ",", "\"Given page is not registered.\"", ")", ";...
Indicates that any modifications to the given PageWrapper have completed. @param page The PageWrapper that has been completed. This instance's offset will be adjusted to the current value of getIndexLength(), and the stored index length will be incremented by this PageWrapper's length.
[ "Indicates", "that", "any", "modifications", "to", "the", "given", "PageWrapper", "have", "completed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/UpdateablePageCollection.java#L93-L105
132,137
pravega/pravega
common/src/main/java/io/pravega/common/util/btree/UpdateablePageCollection.java
UpdateablePageCollection.collectPages
synchronized void collectPages(Collection<Long> offsets, Collection<PageWrapper> target) { offsets.forEach(offset -> { PageWrapper p = this.pageByOffset.getOrDefault(offset, null); if (p != null) { target.add(p); } }); }
java
synchronized void collectPages(Collection<Long> offsets, Collection<PageWrapper> target) { offsets.forEach(offset -> { PageWrapper p = this.pageByOffset.getOrDefault(offset, null); if (p != null) { target.add(p); } }); }
[ "synchronized", "void", "collectPages", "(", "Collection", "<", "Long", ">", "offsets", ",", "Collection", "<", "PageWrapper", ">", "target", ")", "{", "offsets", ".", "forEach", "(", "offset", "->", "{", "PageWrapper", "p", "=", "this", ".", "pageByOffset",...
Collects the PageWrappers with given offsets into the given Collection. @param offsets A Collection of offsets to collect PageWrappers for. @param target The Collection to collect into.
[ "Collects", "the", "PageWrappers", "with", "given", "offsets", "into", "the", "given", "Collection", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/UpdateablePageCollection.java#L131-L138
132,138
pravega/pravega
common/src/main/java/io/pravega/common/util/btree/UpdateablePageCollection.java
UpdateablePageCollection.getPagesSortedByOffset
synchronized List<PageWrapper> getPagesSortedByOffset() { return this.pageByOffset .values().stream() .sorted(Comparator.comparingLong(PageWrapper::getOffset)) .collect(Collectors.toList()); }
java
synchronized List<PageWrapper> getPagesSortedByOffset() { return this.pageByOffset .values().stream() .sorted(Comparator.comparingLong(PageWrapper::getOffset)) .collect(Collectors.toList()); }
[ "synchronized", "List", "<", "PageWrapper", ">", "getPagesSortedByOffset", "(", ")", "{", "return", "this", ".", "pageByOffset", ".", "values", "(", ")", ".", "stream", "(", ")", ".", "sorted", "(", "Comparator", ".", "comparingLong", "(", "PageWrapper", "::...
Gets a new List containing all the PageWrappers in this PageCollection, ordered by their offset. @return The List.
[ "Gets", "a", "new", "List", "containing", "all", "the", "PageWrappers", "in", "this", "PageCollection", "ordered", "by", "their", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/UpdateablePageCollection.java#L144-L149
132,139
pravega/pravega
common/src/main/java/io/pravega/common/concurrent/SequentialProcessor.java
SequentialProcessor.add
public <ReturnType> CompletableFuture<ReturnType> add(Supplier<CompletableFuture<? extends ReturnType>> toRun) { CompletableFuture<ReturnType> result = new CompletableFuture<>(); CompletableFuture<?> existingTask; synchronized (this.lock) { Exceptions.checkNotClosed(this.closed, this...
java
public <ReturnType> CompletableFuture<ReturnType> add(Supplier<CompletableFuture<? extends ReturnType>> toRun) { CompletableFuture<ReturnType> result = new CompletableFuture<>(); CompletableFuture<?> existingTask; synchronized (this.lock) { Exceptions.checkNotClosed(this.closed, this...
[ "public", "<", "ReturnType", ">", "CompletableFuture", "<", "ReturnType", ">", "add", "(", "Supplier", "<", "CompletableFuture", "<", "?", "extends", "ReturnType", ">", ">", "toRun", ")", "{", "CompletableFuture", "<", "ReturnType", ">", "result", "=", "new", ...
Queues up a new task to execute. This task will not begin execution until all previous tasks have finished. In addition, no subsequent task will begin executing until this task has finished executing. @param toRun A Supplier that will be invoked when it is this task's turn to run. It will return a CompletableF...
[ "Queues", "up", "a", "new", "task", "to", "execute", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/SequentialProcessor.java#L62-L92
132,140
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerTableExtensionImpl.java
ContainerTableExtensionImpl.createWriterSegmentProcessors
@Override public Collection<WriterSegmentProcessor> createWriterSegmentProcessors(UpdateableSegmentMetadata metadata) { Exceptions.checkNotClosed(this.closed.get(), this); if (!metadata.getAttributes().containsKey(TableAttributes.INDEX_OFFSET)) { // Not a Table Segment; nothing to do. ...
java
@Override public Collection<WriterSegmentProcessor> createWriterSegmentProcessors(UpdateableSegmentMetadata metadata) { Exceptions.checkNotClosed(this.closed.get(), this); if (!metadata.getAttributes().containsKey(TableAttributes.INDEX_OFFSET)) { // Not a Table Segment; nothing to do. ...
[ "@", "Override", "public", "Collection", "<", "WriterSegmentProcessor", ">", "createWriterSegmentProcessors", "(", "UpdateableSegmentMetadata", "metadata", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ".", "get", "(", ")", ",", "this", ...
region ContainerTableExtension Implementation
[ "region", "ContainerTableExtension", "Implementation" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerTableExtensionImpl.java#L126-L135
132,141
pravega/pravega
common/src/main/java/io/pravega/common/util/ReusableFutureLatch.java
ReusableFutureLatch.registerAndRunReleaser
public void registerAndRunReleaser(Runnable willCallRelease, CompletableFuture<T> toNotify) { boolean run = false; boolean complete = false; T result = null; Throwable e = null; synchronized (lock) { if (released) { complete = true; res...
java
public void registerAndRunReleaser(Runnable willCallRelease, CompletableFuture<T> toNotify) { boolean run = false; boolean complete = false; T result = null; Throwable e = null; synchronized (lock) { if (released) { complete = true; res...
[ "public", "void", "registerAndRunReleaser", "(", "Runnable", "willCallRelease", ",", "CompletableFuture", "<", "T", ">", "toNotify", ")", "{", "boolean", "run", "=", "false", ";", "boolean", "complete", "=", "false", ";", "T", "result", "=", "null", ";", "Th...
If the latch is released, completes the provided future without invoking the provided runnable. If the latch is not released it will add the provided future to the list to be notified and runs the provided runnable if there is not already one running. If there are multiple calls to this method, only the runnable of on...
[ "If", "the", "latch", "is", "released", "completes", "the", "provided", "future", "without", "invoking", "the", "provided", "runnable", ".", "If", "the", "latch", "is", "not", "released", "it", "will", "add", "the", "provided", "future", "to", "the", "list",...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ReusableFutureLatch.java#L77-L118
132,142
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java
ServiceBuilder.withDataLogFactory
public ServiceBuilder withDataLogFactory(Function<ComponentSetup, DurableDataLogFactory> dataLogFactoryCreator) { Preconditions.checkNotNull(dataLogFactoryCreator, "dataLogFactoryCreator"); this.dataLogFactoryCreator = dataLogFactoryCreator; return this; }
java
public ServiceBuilder withDataLogFactory(Function<ComponentSetup, DurableDataLogFactory> dataLogFactoryCreator) { Preconditions.checkNotNull(dataLogFactoryCreator, "dataLogFactoryCreator"); this.dataLogFactoryCreator = dataLogFactoryCreator; return this; }
[ "public", "ServiceBuilder", "withDataLogFactory", "(", "Function", "<", "ComponentSetup", ",", "DurableDataLogFactory", ">", "dataLogFactoryCreator", ")", "{", "Preconditions", ".", "checkNotNull", "(", "dataLogFactoryCreator", ",", "\"dataLogFactoryCreator\"", ")", ";", ...
Attaches the given DurableDataLogFactory creator to this ServiceBuilder. The given Function will only not be invoked right away; it will be called when needed. @param dataLogFactoryCreator The Function to attach. @return This ServiceBuilder.
[ "Attaches", "the", "given", "DurableDataLogFactory", "creator", "to", "this", "ServiceBuilder", ".", "The", "given", "Function", "will", "only", "not", "be", "invoked", "right", "away", ";", "it", "will", "be", "called", "when", "needed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L170-L174
132,143
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java
ServiceBuilder.withStorageFactory
public ServiceBuilder withStorageFactory(Function<ComponentSetup, StorageFactory> storageFactoryCreator) { Preconditions.checkNotNull(storageFactoryCreator, "storageFactoryCreator"); this.storageFactoryCreator = storageFactoryCreator; return this; }
java
public ServiceBuilder withStorageFactory(Function<ComponentSetup, StorageFactory> storageFactoryCreator) { Preconditions.checkNotNull(storageFactoryCreator, "storageFactoryCreator"); this.storageFactoryCreator = storageFactoryCreator; return this; }
[ "public", "ServiceBuilder", "withStorageFactory", "(", "Function", "<", "ComponentSetup", ",", "StorageFactory", ">", "storageFactoryCreator", ")", "{", "Preconditions", ".", "checkNotNull", "(", "storageFactoryCreator", ",", "\"storageFactoryCreator\"", ")", ";", "this",...
Attaches the given StorageFactory creator to this ServiceBuilder. The given Function will only not be invoked right away; it will be called when needed. @param storageFactoryCreator The Function to attach. @return This ServiceBuilder.
[ "Attaches", "the", "given", "StorageFactory", "creator", "to", "this", "ServiceBuilder", ".", "The", "given", "Function", "will", "only", "not", "be", "invoked", "right", "away", ";", "it", "will", "be", "called", "when", "needed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L183-L187
132,144
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java
ServiceBuilder.withContainerManager
public ServiceBuilder withContainerManager(Function<ComponentSetup, SegmentContainerManager> segmentContainerManagerCreator) { Preconditions.checkNotNull(segmentContainerManagerCreator, "segmentContainerManagerCreator"); this.segmentContainerManagerCreator = segmentContainerManagerCreator; retur...
java
public ServiceBuilder withContainerManager(Function<ComponentSetup, SegmentContainerManager> segmentContainerManagerCreator) { Preconditions.checkNotNull(segmentContainerManagerCreator, "segmentContainerManagerCreator"); this.segmentContainerManagerCreator = segmentContainerManagerCreator; retur...
[ "public", "ServiceBuilder", "withContainerManager", "(", "Function", "<", "ComponentSetup", ",", "SegmentContainerManager", ">", "segmentContainerManagerCreator", ")", "{", "Preconditions", ".", "checkNotNull", "(", "segmentContainerManagerCreator", ",", "\"segmentContainerMana...
Attaches the given SegmentContainerManager creator to this ServiceBuilder. The given Function will only not be invoked right away; it will be called when needed. @param segmentContainerManagerCreator The Function to attach. @return This ServiceBuilder.
[ "Attaches", "the", "given", "SegmentContainerManager", "creator", "to", "this", "ServiceBuilder", ".", "The", "given", "Function", "will", "only", "not", "be", "invoked", "right", "away", ";", "it", "will", "be", "called", "when", "needed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L196-L200
132,145
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java
ServiceBuilder.withCacheFactory
public ServiceBuilder withCacheFactory(Function<ComponentSetup, CacheFactory> cacheFactoryCreator) { Preconditions.checkNotNull(cacheFactoryCreator, "cacheFactoryCreator"); this.cacheFactoryCreator = cacheFactoryCreator; return this; }
java
public ServiceBuilder withCacheFactory(Function<ComponentSetup, CacheFactory> cacheFactoryCreator) { Preconditions.checkNotNull(cacheFactoryCreator, "cacheFactoryCreator"); this.cacheFactoryCreator = cacheFactoryCreator; return this; }
[ "public", "ServiceBuilder", "withCacheFactory", "(", "Function", "<", "ComponentSetup", ",", "CacheFactory", ">", "cacheFactoryCreator", ")", "{", "Preconditions", ".", "checkNotNull", "(", "cacheFactoryCreator", ",", "\"cacheFactoryCreator\"", ")", ";", "this", ".", ...
Attaches the given CacheFactory creator to this ServiceBuilder. The given Function will only not be invoked right away; it will be called when needed. @param cacheFactoryCreator The Function to attach. @return This ServiceBuilder.
[ "Attaches", "the", "given", "CacheFactory", "creator", "to", "this", "ServiceBuilder", ".", "The", "given", "Function", "will", "only", "not", "be", "invoked", "right", "away", ";", "it", "will", "be", "called", "when", "needed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L209-L213
132,146
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java
ServiceBuilder.withStreamSegmentStore
public ServiceBuilder withStreamSegmentStore(Function<ComponentSetup, StreamSegmentStore> streamSegmentStoreCreator) { Preconditions.checkNotNull(streamSegmentStoreCreator, "streamSegmentStoreCreator"); this.streamSegmentStoreCreator = streamSegmentStoreCreator; return this; }
java
public ServiceBuilder withStreamSegmentStore(Function<ComponentSetup, StreamSegmentStore> streamSegmentStoreCreator) { Preconditions.checkNotNull(streamSegmentStoreCreator, "streamSegmentStoreCreator"); this.streamSegmentStoreCreator = streamSegmentStoreCreator; return this; }
[ "public", "ServiceBuilder", "withStreamSegmentStore", "(", "Function", "<", "ComponentSetup", ",", "StreamSegmentStore", ">", "streamSegmentStoreCreator", ")", "{", "Preconditions", ".", "checkNotNull", "(", "streamSegmentStoreCreator", ",", "\"streamSegmentStoreCreator\"", "...
Attaches the given StreamSegmentStore creator to this ServiceBuilder. The given Function will not be invoked right away; it will be called when needed. @param streamSegmentStoreCreator The Function to attach. @return This ServiceBuilder.
[ "Attaches", "the", "given", "StreamSegmentStore", "creator", "to", "this", "ServiceBuilder", ".", "The", "given", "Function", "will", "not", "be", "invoked", "right", "away", ";", "it", "will", "be", "called", "when", "needed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L222-L226
132,147
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java
ServiceBuilder.createTableStoreService
public TableStore createTableStoreService() { return getSingleton(this.tableStoreService, setup -> new TableService(setup.getContainerRegistry(), setup.getSegmentToContainerMapper())); }
java
public TableStore createTableStoreService() { return getSingleton(this.tableStoreService, setup -> new TableService(setup.getContainerRegistry(), setup.getSegmentToContainerMapper())); }
[ "public", "TableStore", "createTableStoreService", "(", ")", "{", "return", "getSingleton", "(", "this", ".", "tableStoreService", ",", "setup", "->", "new", "TableService", "(", "setup", ".", "getContainerRegistry", "(", ")", ",", "setup", ".", "getSegmentToConta...
Creates a new instance of TableStore using the components generated by this class. @return The new instance of TableStore using the components generated by this class.
[ "Creates", "a", "new", "instance", "of", "TableStore", "using", "the", "components", "generated", "by", "this", "class", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L244-L246
132,148
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java
ServiceBuilder.initialize
public void initialize() throws DurableDataLogException { this.cacheManager.startAsync().awaitRunning(); getSingleton(this.dataLogFactory, this.dataLogFactoryCreator).initialize(); getSingleton(this.containerManager, this.segmentContainerManagerCreator).initialize(); }
java
public void initialize() throws DurableDataLogException { this.cacheManager.startAsync().awaitRunning(); getSingleton(this.dataLogFactory, this.dataLogFactoryCreator).initialize(); getSingleton(this.containerManager, this.segmentContainerManagerCreator).initialize(); }
[ "public", "void", "initialize", "(", ")", "throws", "DurableDataLogException", "{", "this", ".", "cacheManager", ".", "startAsync", "(", ")", ".", "awaitRunning", "(", ")", ";", "getSingleton", "(", "this", ".", "dataLogFactory", ",", "this", ".", "dataLogFact...
Initializes the ServiceBuilder. @throws DurableDataLogException If unable to initialize DurableDataLogFactory.
[ "Initializes", "the", "ServiceBuilder", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L253-L257
132,149
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java
ServiceBuilder.newInMemoryBuilder
@VisibleForTesting public static ServiceBuilder newInMemoryBuilder(ServiceBuilderConfig builderConfig, ExecutorBuilder executorBuilder) { ServiceConfig serviceConfig = builderConfig.getConfig(ServiceConfig::builder); ServiceBuilder builder; if (serviceConfig.isReadOnlySegmentStore()) { ...
java
@VisibleForTesting public static ServiceBuilder newInMemoryBuilder(ServiceBuilderConfig builderConfig, ExecutorBuilder executorBuilder) { ServiceConfig serviceConfig = builderConfig.getConfig(ServiceConfig::builder); ServiceBuilder builder; if (serviceConfig.isReadOnlySegmentStore()) { ...
[ "@", "VisibleForTesting", "public", "static", "ServiceBuilder", "newInMemoryBuilder", "(", "ServiceBuilderConfig", "builderConfig", ",", "ExecutorBuilder", "executorBuilder", ")", "{", "ServiceConfig", "serviceConfig", "=", "builderConfig", ".", "getConfig", "(", "ServiceCo...
Creates a new instance of the ServiceBuilder class which is contained in memory. Any data added to this service will be lost when the object is garbage collected or the process terminates. @param builderConfig The ServiceBuilderConfig to use. @param executorBuilder A Function that, given a thread count and a pool na...
[ "Creates", "a", "new", "instance", "of", "the", "ServiceBuilder", "class", "which", "is", "contained", "in", "memory", ".", "Any", "data", "added", "to", "this", "service", "will", "be", "lost", "when", "the", "object", "is", "garbage", "collected", "or", ...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/store/ServiceBuilder.java#L386-L408
132,150
pravega/pravega
client/src/main/java/io/pravega/client/stream/notifications/NotificationSystem.java
NotificationSystem.removeListener
@Synchronized public <T extends Notification> void removeListener(final String type, final Listener<T> listener) { map.get(type).removeIf(e -> e.getListener().equals(listener)); }
java
@Synchronized public <T extends Notification> void removeListener(final String type, final Listener<T> listener) { map.get(type).removeIf(e -> e.getListener().equals(listener)); }
[ "@", "Synchronized", "public", "<", "T", "extends", "Notification", ">", "void", "removeListener", "(", "final", "String", "type", ",", "final", "Listener", "<", "T", ">", "listener", ")", "{", "map", ".", "get", "(", "type", ")", ".", "removeIf", "(", ...
Remove Listener of a given notification type. @param <T> Type of notification. @param type Type of notification listener. @param listener Listener to be removed.
[ "Remove", "Listener", "of", "a", "given", "notification", "type", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/notifications/NotificationSystem.java#L63-L66
132,151
pravega/pravega
segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/AsyncStorageWrapper.java
AsyncStorageWrapper.supplyAsync
private <R> CompletableFuture<R> supplyAsync(Callable<R> operation, String... segmentNames) { Exceptions.checkNotClosed(this.closed.get(), this); return this.taskProcessor.add(Arrays.asList(segmentNames), () -> execute(operation)); }
java
private <R> CompletableFuture<R> supplyAsync(Callable<R> operation, String... segmentNames) { Exceptions.checkNotClosed(this.closed.get(), this); return this.taskProcessor.add(Arrays.asList(segmentNames), () -> execute(operation)); }
[ "private", "<", "R", ">", "CompletableFuture", "<", "R", ">", "supplyAsync", "(", "Callable", "<", "R", ">", "operation", ",", "String", "...", "segmentNames", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ".", "get", "(", ")...
Executes the given Callable asynchronously and returns a CompletableFuture that will be completed with the result. @param operation The Callable to execute. @param segmentNames The names of the Segments involved in this operation (for sequencing purposes).
[ "Executes", "the", "given", "Callable", "asynchronously", "and", "returns", "a", "CompletableFuture", "that", "will", "be", "completed", "with", "the", "result", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/AsyncStorageWrapper.java#L158-L161
132,152
pravega/pravega
segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/AsyncStorageWrapper.java
AsyncStorageWrapper.runAsync
private CompletableFuture<Void> runAsync(RunnableWithException operation, String... segmentNames) { return supplyAsync(() -> { operation.run(); return null; }, segmentNames); }
java
private CompletableFuture<Void> runAsync(RunnableWithException operation, String... segmentNames) { return supplyAsync(() -> { operation.run(); return null; }, segmentNames); }
[ "private", "CompletableFuture", "<", "Void", ">", "runAsync", "(", "RunnableWithException", "operation", ",", "String", "...", "segmentNames", ")", "{", "return", "supplyAsync", "(", "(", ")", "->", "{", "operation", ".", "run", "(", ")", ";", "return", "nul...
Executes the given RunnableWithException asynchronously and returns a CompletableFuture that will be completed when the Runnable completes. @param operation The RunnableWithException to execute. @param segmentNames The names of the Segments involved in this operation (for sequencing purposes).
[ "Executes", "the", "given", "RunnableWithException", "asynchronously", "and", "returns", "a", "CompletableFuture", "that", "will", "be", "completed", "when", "the", "Runnable", "completes", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/AsyncStorageWrapper.java#L169-L174
132,153
pravega/pravega
segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/AsyncStorageWrapper.java
AsyncStorageWrapper.execute
private <R> CompletableFuture<R> execute(Callable<R> operation) { return CompletableFuture.supplyAsync(() -> { try { return operation.call(); } catch (Exception ex) { throw new CompletionException(ex); } }, this.executor); }
java
private <R> CompletableFuture<R> execute(Callable<R> operation) { return CompletableFuture.supplyAsync(() -> { try { return operation.call(); } catch (Exception ex) { throw new CompletionException(ex); } }, this.executor); }
[ "private", "<", "R", ">", "CompletableFuture", "<", "R", ">", "execute", "(", "Callable", "<", "R", ">", "operation", ")", "{", "return", "CompletableFuture", ".", "supplyAsync", "(", "(", ")", "->", "{", "try", "{", "return", "operation", ".", "call", ...
Executes the given Callable synchronously and invokes cleanup when done. @param operation The Callable to execute.
[ "Executes", "the", "given", "Callable", "synchronously", "and", "invokes", "cleanup", "when", "done", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/AsyncStorageWrapper.java#L181-L189
132,154
pravega/pravega
controller/src/main/java/io/pravega/controller/server/AuthResourceRepresentation.java
AuthResourceRepresentation.ofStreamInScope
public static String ofStreamInScope(String scopeName, String streamName) { Exceptions.checkNotNullOrEmpty(streamName, "streamName"); return String.format("%s/%s", ofStreamsInScope(scopeName), streamName); }
java
public static String ofStreamInScope(String scopeName, String streamName) { Exceptions.checkNotNullOrEmpty(streamName, "streamName"); return String.format("%s/%s", ofStreamsInScope(scopeName), streamName); }
[ "public", "static", "String", "ofStreamInScope", "(", "String", "scopeName", ",", "String", "streamName", ")", "{", "Exceptions", ".", "checkNotNullOrEmpty", "(", "streamName", ",", "\"streamName\"", ")", ";", "return", "String", ".", "format", "(", "\"%s/%s\"", ...
Creates a resource representation for use in authorization of actions pertaining to the specified stream within the specified scope. @param scopeName the name of the scope @param streamName the name of the stream @return a string representing the specified stream within the specified scope @throws NullPointerException...
[ "Creates", "a", "resource", "representation", "for", "use", "in", "authorization", "of", "actions", "pertaining", "to", "the", "specified", "stream", "within", "the", "specified", "scope", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/AuthResourceRepresentation.java#L77-L80
132,155
pravega/pravega
controller/src/main/java/io/pravega/controller/server/AuthResourceRepresentation.java
AuthResourceRepresentation.ofReaderGroupInScope
public static String ofReaderGroupInScope(String scopeName, String readerGroupName) { Exceptions.checkNotNullOrEmpty(readerGroupName, "readerGroupName"); return String.format("%s/%s", ofReaderGroupsInScope(scopeName), readerGroupName); }
java
public static String ofReaderGroupInScope(String scopeName, String readerGroupName) { Exceptions.checkNotNullOrEmpty(readerGroupName, "readerGroupName"); return String.format("%s/%s", ofReaderGroupsInScope(scopeName), readerGroupName); }
[ "public", "static", "String", "ofReaderGroupInScope", "(", "String", "scopeName", ",", "String", "readerGroupName", ")", "{", "Exceptions", ".", "checkNotNullOrEmpty", "(", "readerGroupName", ",", "\"readerGroupName\"", ")", ";", "return", "String", ".", "format", "...
Creates a resource representation for use in authorization of actions pertaining to the specified reader group within the specified scope. @param scopeName the name of the scope @param readerGroupName the name of the reader group @return a string representing the specified reader group @throws NullPointerException if ...
[ "Creates", "a", "resource", "representation", "for", "use", "in", "authorization", "of", "actions", "pertaining", "to", "the", "specified", "reader", "group", "within", "the", "specified", "scope", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/AuthResourceRepresentation.java#L106-L109
132,156
pravega/pravega
common/src/main/java/io/pravega/common/Exceptions.java
Exceptions.unwrap
public static Throwable unwrap(Throwable ex) { if (canInspectCause(ex)) { Throwable cause = ex.getCause(); if (cause != null) { return unwrap(cause); } } return ex; }
java
public static Throwable unwrap(Throwable ex) { if (canInspectCause(ex)) { Throwable cause = ex.getCause(); if (cause != null) { return unwrap(cause); } } return ex; }
[ "public", "static", "Throwable", "unwrap", "(", "Throwable", "ex", ")", "{", "if", "(", "canInspectCause", "(", "ex", ")", ")", "{", "Throwable", "cause", "=", "ex", ".", "getCause", "(", ")", ";", "if", "(", "cause", "!=", "null", ")", "{", "return"...
If the provided exception is a CompletionException or ExecutionException which need be unwrapped. @param ex The exception to be unwrapped. @return The cause or the exception provided.
[ "If", "the", "provided", "exception", "is", "a", "CompletionException", "or", "ExecutionException", "which", "need", "be", "unwrapped", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L66-L75
132,157
pravega/pravega
common/src/main/java/io/pravega/common/Exceptions.java
Exceptions.shouldUnwrap
public static boolean shouldUnwrap(Class<? extends Exception> c) { return c.equals(CompletionException.class) || c.equals(ExecutionException.class); }
java
public static boolean shouldUnwrap(Class<? extends Exception> c) { return c.equals(CompletionException.class) || c.equals(ExecutionException.class); }
[ "public", "static", "boolean", "shouldUnwrap", "(", "Class", "<", "?", "extends", "Exception", ">", "c", ")", "{", "return", "c", ".", "equals", "(", "CompletionException", ".", "class", ")", "||", "c", ".", "equals", "(", "ExecutionException", ".", "class...
Returns true if the provided class is CompletionException or ExecutionException which need to be unwrapped. @param c The class to be tested @return True if {@link #unwrap(Throwable)} should be called on exceptions of this type
[ "Returns", "true", "if", "the", "provided", "class", "is", "CompletionException", "or", "ExecutionException", "which", "need", "to", "be", "unwrapped", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L82-L84
132,158
pravega/pravega
common/src/main/java/io/pravega/common/Exceptions.java
Exceptions.checkNotNullOrEmpty
public static String checkNotNullOrEmpty(String arg, String argName) throws NullPointerException, IllegalArgumentException { Preconditions.checkNotNull(arg, argName); checkArgument(arg.length() > 0, argName, "Cannot be an empty string."); return arg; }
java
public static String checkNotNullOrEmpty(String arg, String argName) throws NullPointerException, IllegalArgumentException { Preconditions.checkNotNull(arg, argName); checkArgument(arg.length() > 0, argName, "Cannot be an empty string."); return arg; }
[ "public", "static", "String", "checkNotNullOrEmpty", "(", "String", "arg", ",", "String", "argName", ")", "throws", "NullPointerException", ",", "IllegalArgumentException", "{", "Preconditions", ".", "checkNotNull", "(", "arg", ",", "argName", ")", ";", "checkArgume...
Throws a NullPointerException if the arg argument is null. Throws an IllegalArgumentException if the String arg argument has a length of zero. @param arg The argument to check. @param argName The name of the argument (to be included in the exception message). @return The arg. @throws NullPointerException If ar...
[ "Throws", "a", "NullPointerException", "if", "the", "arg", "argument", "is", "null", ".", "Throws", "an", "IllegalArgumentException", "if", "the", "String", "arg", "argument", "has", "a", "length", "of", "zero", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L155-L159
132,159
pravega/pravega
common/src/main/java/io/pravega/common/Exceptions.java
Exceptions.checkNotNullOrEmpty
public static <T, V extends Collection<T>> V checkNotNullOrEmpty(V arg, String argName) throws NullPointerException, IllegalArgumentException { Preconditions.checkNotNull(arg, argName); checkArgument(!arg.isEmpty(), argName, "Cannot be an empty collection."); return arg; }
java
public static <T, V extends Collection<T>> V checkNotNullOrEmpty(V arg, String argName) throws NullPointerException, IllegalArgumentException { Preconditions.checkNotNull(arg, argName); checkArgument(!arg.isEmpty(), argName, "Cannot be an empty collection."); return arg; }
[ "public", "static", "<", "T", ",", "V", "extends", "Collection", "<", "T", ">", ">", "V", "checkNotNullOrEmpty", "(", "V", "arg", ",", "String", "argName", ")", "throws", "NullPointerException", ",", "IllegalArgumentException", "{", "Preconditions", ".", "chec...
Throws a NullPointerException if the arg argument is null. Throws an IllegalArgumentException if the Collections arg argument has a size of zero. @param <T> The type of elements in the provided collection. @param <V> The actual type of the collection. @param arg The argument to check. @param argName The na...
[ "Throws", "a", "NullPointerException", "if", "the", "arg", "argument", "is", "null", ".", "Throws", "an", "IllegalArgumentException", "if", "the", "Collections", "arg", "argument", "has", "a", "size", "of", "zero", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L173-L177
132,160
pravega/pravega
common/src/main/java/io/pravega/common/Exceptions.java
Exceptions.checkNotNullOrEmpty
public static <K, V> Map<K, V> checkNotNullOrEmpty(Map<K, V> arg, String argName) throws NullPointerException, IllegalArgumentException { Preconditions.checkNotNull(arg, argName); checkArgument(!arg.isEmpty(), argName,...
java
public static <K, V> Map<K, V> checkNotNullOrEmpty(Map<K, V> arg, String argName) throws NullPointerException, IllegalArgumentException { Preconditions.checkNotNull(arg, argName); checkArgument(!arg.isEmpty(), argName,...
[ "public", "static", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "V", ">", "checkNotNullOrEmpty", "(", "Map", "<", "K", ",", "V", ">", "arg", ",", "String", "argName", ")", "throws", "NullPointerException", ",", "IllegalArgumentException", "{", "Precon...
Throws a NullPointerException if the arg argument is null. Throws an IllegalArgumentException if the Map arg argument has a size of zero. @param <K> The type of keys in the provided map. @param <V> The type of keys in the provided map. @param arg The argument to check. @param argName The name of the argument (to be in...
[ "Throws", "a", "NullPointerException", "if", "the", "arg", "argument", "is", "null", ".", "Throws", "an", "IllegalArgumentException", "if", "the", "Map", "arg", "argument", "has", "a", "size", "of", "zero", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L191-L196
132,161
pravega/pravega
common/src/main/java/io/pravega/common/Exceptions.java
Exceptions.checkArgument
public static void checkArgument(boolean validCondition, String argName, String message, Object... args) throws IllegalArgumentException { if (!validCondition) { throw new IllegalArgumentException(badArgumentMessage(argName, message, args)); } }
java
public static void checkArgument(boolean validCondition, String argName, String message, Object... args) throws IllegalArgumentException { if (!validCondition) { throw new IllegalArgumentException(badArgumentMessage(argName, message, args)); } }
[ "public", "static", "void", "checkArgument", "(", "boolean", "validCondition", ",", "String", "argName", ",", "String", "message", ",", "Object", "...", "args", ")", "throws", "IllegalArgumentException", "{", "if", "(", "!", "validCondition", ")", "{", "throw", ...
Throws an IllegalArgumentException if the validCondition argument is false. @param validCondition The result of the condition to validate. @param argName The name of the argument (to be included in the exception message). @param message The message to include in the exception. This should not include the...
[ "Throws", "an", "IllegalArgumentException", "if", "the", "validCondition", "argument", "is", "false", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L208-L212
132,162
pravega/pravega
common/src/main/java/io/pravega/common/Exceptions.java
Exceptions.checkArrayRange
public static void checkArrayRange(long startIndex, int length, long arrayLength, String startIndexArgName, String lengthArgName) throws ArrayIndexOutOfBoundsException, IllegalArgumentException { // Check for non-negative length. if (length < 0) { throw new IllegalArgumentException(badArgume...
java
public static void checkArrayRange(long startIndex, int length, long arrayLength, String startIndexArgName, String lengthArgName) throws ArrayIndexOutOfBoundsException, IllegalArgumentException { // Check for non-negative length. if (length < 0) { throw new IllegalArgumentException(badArgume...
[ "public", "static", "void", "checkArrayRange", "(", "long", "startIndex", ",", "int", "length", ",", "long", "arrayLength", ",", "String", "startIndexArgName", ",", "String", "lengthArgName", ")", "throws", "ArrayIndexOutOfBoundsException", ",", "IllegalArgumentExceptio...
Throws an appropriate exception if the given range is not included in the given array interval. @param startIndex The First index in the range. @param length The number of items in the range. @param arrayLength The length of the array. @param startIndexArgName The name of the start index argume...
[ "Throws", "an", "appropriate", "exception", "if", "the", "given", "range", "is", "not", "included", "in", "the", "given", "array", "interval", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/Exceptions.java#L226-L244
132,163
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/ZkOrderedStore.java
ZkOrderedStore.removeEntities
CompletableFuture<Void> removeEntities(String scope, String stream, Collection<Long> entities) { Set<Integer> collections = entities.stream().collect(Collectors.groupingBy(x -> new Position(x).collectionNumber)).keySet(); return Futures.allOf(entities.stream() .map(e...
java
CompletableFuture<Void> removeEntities(String scope, String stream, Collection<Long> entities) { Set<Integer> collections = entities.stream().collect(Collectors.groupingBy(x -> new Position(x).collectionNumber)).keySet(); return Futures.allOf(entities.stream() .map(e...
[ "CompletableFuture", "<", "Void", ">", "removeEntities", "(", "String", "scope", ",", "String", "stream", ",", "Collection", "<", "Long", ">", "entities", ")", "{", "Set", "<", "Integer", ">", "collections", "=", "entities", ".", "stream", "(", ")", ".", ...
Method to remove entities from the ordered set. Entities are referred to by their position pointer. @param scope scope @param stream stream @param entities list of entities' positions to remove @return CompletableFuture which when completed will indicate that entities are removed from the set.
[ "Method", "to", "remove", "entities", "from", "the", "ordered", "set", ".", "Entities", "are", "referred", "to", "by", "their", "position", "pointer", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/ZkOrderedStore.java#L137-L158
132,164
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/ZkOrderedStore.java
ZkOrderedStore.tryDeleteSealedCollection
private CompletableFuture<Void> tryDeleteSealedCollection(String scope, String stream, Integer collectionNum) { // purge garbage znodes // attempt to delete entities node // delete collection return getLatestCollection(scope, stream) .thenCompose(latestcollectionNum -> ...
java
private CompletableFuture<Void> tryDeleteSealedCollection(String scope, String stream, Integer collectionNum) { // purge garbage znodes // attempt to delete entities node // delete collection return getLatestCollection(scope, stream) .thenCompose(latestcollectionNum -> ...
[ "private", "CompletableFuture", "<", "Void", ">", "tryDeleteSealedCollection", "(", "String", "scope", ",", "String", "stream", ",", "Integer", "collectionNum", ")", "{", "// purge garbage znodes", "// attempt to delete entities node", "// delete collection", "return", "get...
Collection should be sealed while calling this method @param scope scope @param stream stream @param collectionNum collection to delete @return future which when completed will have the collection deleted if it is empty or ignored otherwise.
[ "Collection", "should", "be", "sealed", "while", "calling", "this", "method" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/ZkOrderedStore.java#L263-L286
132,165
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.preProcessOperation
void preProcessOperation(StreamSegmentAppendOperation operation) throws StreamSegmentSealedException, StreamSegmentMergedException, BadOffsetException, BadAttributeUpdateException { ensureSegmentId(operation); if (this.merged) { // We do not allow any operation after merging (sin...
java
void preProcessOperation(StreamSegmentAppendOperation operation) throws StreamSegmentSealedException, StreamSegmentMergedException, BadOffsetException, BadAttributeUpdateException { ensureSegmentId(operation); if (this.merged) { // We do not allow any operation after merging (sin...
[ "void", "preProcessOperation", "(", "StreamSegmentAppendOperation", "operation", ")", "throws", "StreamSegmentSealedException", ",", "StreamSegmentMergedException", ",", "BadOffsetException", ",", "BadAttributeUpdateException", "{", "ensureSegmentId", "(", "operation", ")", ";"...
Pre-processes a StreamSegmentAppendOperation. After this method returns, the given operation will have its SegmentOffset property set to the current SegmentLength, and all AttributeUpdates will be set to the current values. @param operation The operation to pre-process. @throws StreamSegmentSealedException If the Segm...
[ "Pre", "-", "processes", "a", "StreamSegmentAppendOperation", ".", "After", "this", "method", "returns", "the", "given", "operation", "will", "have", "its", "SegmentOffset", "property", "set", "to", "the", "current", "SegmentLength", "and", "all", "AttributeUpdates"...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L244-L272
132,166
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.preProcessOperation
void preProcessOperation(UpdateAttributesOperation operation) throws StreamSegmentSealedException, StreamSegmentMergedException, BadAttributeUpdateException { ensureSegmentId(operation); if (this.merged) { // We do not allow any operation after merging (since after merging the Se...
java
void preProcessOperation(UpdateAttributesOperation operation) throws StreamSegmentSealedException, StreamSegmentMergedException, BadAttributeUpdateException { ensureSegmentId(operation); if (this.merged) { // We do not allow any operation after merging (since after merging the Se...
[ "void", "preProcessOperation", "(", "UpdateAttributesOperation", "operation", ")", "throws", "StreamSegmentSealedException", ",", "StreamSegmentMergedException", ",", "BadAttributeUpdateException", "{", "ensureSegmentId", "(", "operation", ")", ";", "if", "(", "this", ".", ...
Pre-processes a UpdateAttributesOperation. After this method returns, the given operation will have its AttributeUpdates set to the current values of those attributes. @param operation The operation to pre-process. @throws StreamSegmentSealedException If the Segment is sealed. @throws StreamSegmentMergedException If t...
[ "Pre", "-", "processes", "a", "UpdateAttributesOperation", ".", "After", "this", "method", "returns", "the", "given", "operation", "will", "have", "its", "AttributeUpdates", "set", "to", "the", "current", "values", "of", "those", "attributes", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L286-L301
132,167
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.preProcessOperation
void preProcessOperation(StreamSegmentSealOperation operation) throws StreamSegmentSealedException, StreamSegmentMergedException { ensureSegmentId(operation); if (this.merged) { // We do not allow any operation after merging (since after merging the Stream disappears). throw new ...
java
void preProcessOperation(StreamSegmentSealOperation operation) throws StreamSegmentSealedException, StreamSegmentMergedException { ensureSegmentId(operation); if (this.merged) { // We do not allow any operation after merging (since after merging the Stream disappears). throw new ...
[ "void", "preProcessOperation", "(", "StreamSegmentSealOperation", "operation", ")", "throws", "StreamSegmentSealedException", ",", "StreamSegmentMergedException", "{", "ensureSegmentId", "(", "operation", ")", ";", "if", "(", "this", ".", "merged", ")", "{", "// We do n...
Pre-processes a StreamSegmentSealOperation. After this method returns, the operation will have its SegmentLength property set to the current length of the Segment. @param operation The Operation. @throws StreamSegmentSealedException If the Segment is already sealed. @throws StreamSegmentMergedException If the Segment ...
[ "Pre", "-", "processes", "a", "StreamSegmentSealOperation", ".", "After", "this", "method", "returns", "the", "operation", "will", "have", "its", "SegmentLength", "property", "set", "to", "the", "current", "length", "of", "the", "Segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L312-L328
132,168
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.preProcessOperation
void preProcessOperation(StreamSegmentTruncateOperation operation) throws BadOffsetException { ensureSegmentId(operation); if (operation.getStreamSegmentOffset() < this.startOffset || operation.getStreamSegmentOffset() > this.length) { String msg = String.format("Truncation Offset must be at...
java
void preProcessOperation(StreamSegmentTruncateOperation operation) throws BadOffsetException { ensureSegmentId(operation); if (operation.getStreamSegmentOffset() < this.startOffset || operation.getStreamSegmentOffset() > this.length) { String msg = String.format("Truncation Offset must be at...
[ "void", "preProcessOperation", "(", "StreamSegmentTruncateOperation", "operation", ")", "throws", "BadOffsetException", "{", "ensureSegmentId", "(", "operation", ")", ";", "if", "(", "operation", ".", "getStreamSegmentOffset", "(", ")", "<", "this", ".", "startOffset"...
Pre-processes a StreamSegmentTruncateOperation. @param operation The Operation. @throws BadOffsetException If the operation's Offset is not between the current StartOffset and current EndOffset (SegmentLength - 1).
[ "Pre", "-", "processes", "a", "StreamSegmentTruncateOperation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L337-L344
132,169
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.preProcessAsSourceSegment
void preProcessAsSourceSegment(MergeSegmentOperation operation) throws StreamSegmentNotSealedException, StreamSegmentMergedException, StreamSegmentTruncatedException { Exceptions.checkArgument(this.id == operation.getSourceSegmentId(), "operation", "Invalid Operation Source Segment I...
java
void preProcessAsSourceSegment(MergeSegmentOperation operation) throws StreamSegmentNotSealedException, StreamSegmentMergedException, StreamSegmentTruncatedException { Exceptions.checkArgument(this.id == operation.getSourceSegmentId(), "operation", "Invalid Operation Source Segment I...
[ "void", "preProcessAsSourceSegment", "(", "MergeSegmentOperation", "operation", ")", "throws", "StreamSegmentNotSealedException", ",", "StreamSegmentMergedException", ",", "StreamSegmentTruncatedException", "{", "Exceptions", ".", "checkArgument", "(", "this", ".", "id", "=="...
Pre-processes the given operation as a Source Segment. @param operation The operation. @throws IllegalArgumentException If the operation is for a different Segment. @throws StreamSegmentNotSealedException If the Segment is not sealed. @throws StreamSegmentMergedException If the Segment is already merged. @th...
[ "Pre", "-", "processes", "the", "given", "operation", "as", "a", "Source", "Segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L401-L421
132,170
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.acceptOperation
void acceptOperation(StreamSegmentAppendOperation operation) throws MetadataUpdateException { ensureSegmentId(operation); if (operation.getStreamSegmentOffset() != this.length) { throw new MetadataUpdateException(this.containerId, String.format("SegmentAppendOperation off...
java
void acceptOperation(StreamSegmentAppendOperation operation) throws MetadataUpdateException { ensureSegmentId(operation); if (operation.getStreamSegmentOffset() != this.length) { throw new MetadataUpdateException(this.containerId, String.format("SegmentAppendOperation off...
[ "void", "acceptOperation", "(", "StreamSegmentAppendOperation", "operation", ")", "throws", "MetadataUpdateException", "{", "ensureSegmentId", "(", "operation", ")", ";", "if", "(", "operation", ".", "getStreamSegmentOffset", "(", ")", "!=", "this", ".", "length", "...
Accepts a StreamSegmentAppendOperation in the metadata. @param operation The operation to accept. @throws MetadataUpdateException If the operation SegmentOffset is different from the current Segment Length. @throws IllegalArgumentException If the operation is for a different Segment.
[ "Accepts", "a", "StreamSegmentAppendOperation", "in", "the", "metadata", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L501-L512
132,171
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.acceptOperation
void acceptOperation(UpdateAttributesOperation operation) { ensureSegmentId(operation); acceptAttributes(operation.getAttributeUpdates()); this.isChanged = true; }
java
void acceptOperation(UpdateAttributesOperation operation) { ensureSegmentId(operation); acceptAttributes(operation.getAttributeUpdates()); this.isChanged = true; }
[ "void", "acceptOperation", "(", "UpdateAttributesOperation", "operation", ")", "{", "ensureSegmentId", "(", "operation", ")", ";", "acceptAttributes", "(", "operation", ".", "getAttributeUpdates", "(", ")", ")", ";", "this", ".", "isChanged", "=", "true", ";", "...
Accepts an UpdateAttributesOperation in the metadata. @param operation The operation to accept. @throws IllegalArgumentException If the operation is for a different Segment.
[ "Accepts", "an", "UpdateAttributesOperation", "in", "the", "metadata", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L520-L524
132,172
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.acceptOperation
void acceptOperation(StreamSegmentSealOperation operation) throws MetadataUpdateException { ensureSegmentId(operation); if (operation.getStreamSegmentOffset() < 0) { throw new MetadataUpdateException(containerId, "StreamSegmentSealOperation cannot be accepted if it hasn't...
java
void acceptOperation(StreamSegmentSealOperation operation) throws MetadataUpdateException { ensureSegmentId(operation); if (operation.getStreamSegmentOffset() < 0) { throw new MetadataUpdateException(containerId, "StreamSegmentSealOperation cannot be accepted if it hasn't...
[ "void", "acceptOperation", "(", "StreamSegmentSealOperation", "operation", ")", "throws", "MetadataUpdateException", "{", "ensureSegmentId", "(", "operation", ")", ";", "if", "(", "operation", ".", "getStreamSegmentOffset", "(", ")", "<", "0", ")", "{", "throw", "...
Accepts a StreamSegmentSealOperation in the metadata. @param operation The operation to accept. @throws MetadataUpdateException If the operation hasn't been pre-processed. @throws IllegalArgumentException If the operation is for a different Segment.
[ "Accepts", "a", "StreamSegmentSealOperation", "in", "the", "metadata", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L533-L542
132,173
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.acceptOperation
void acceptOperation(StreamSegmentTruncateOperation operation) { ensureSegmentId(operation); this.startOffset = operation.getStreamSegmentOffset(); this.isChanged = true; }
java
void acceptOperation(StreamSegmentTruncateOperation operation) { ensureSegmentId(operation); this.startOffset = operation.getStreamSegmentOffset(); this.isChanged = true; }
[ "void", "acceptOperation", "(", "StreamSegmentTruncateOperation", "operation", ")", "{", "ensureSegmentId", "(", "operation", ")", ";", "this", ".", "startOffset", "=", "operation", ".", "getStreamSegmentOffset", "(", ")", ";", "this", ".", "isChanged", "=", "true...
Accepts a StreamSegmentTruncateOperation in the metadata. @param operation The operation to accept.
[ "Accepts", "a", "StreamSegmentTruncateOperation", "in", "the", "metadata", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L549-L553
132,174
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.acceptAsSourceSegment
void acceptAsSourceSegment(MergeSegmentOperation operation) { Exceptions.checkArgument(this.id == operation.getSourceSegmentId(), "operation", "Invalid Operation Source Segment Id."); this.sealed = true; this.merged = true; this.isChanged = true; }
java
void acceptAsSourceSegment(MergeSegmentOperation operation) { Exceptions.checkArgument(this.id == operation.getSourceSegmentId(), "operation", "Invalid Operation Source Segment Id."); this.sealed = true; this.merged = true; this.isChanged = true; }
[ "void", "acceptAsSourceSegment", "(", "MergeSegmentOperation", "operation", ")", "{", "Exceptions", ".", "checkArgument", "(", "this", ".", "id", "==", "operation", ".", "getSourceSegmentId", "(", ")", ",", "\"operation\"", ",", "\"Invalid Operation Source Segment Id.\"...
Accepts the given operation as a Source Segment. @param operation The operation. @throws IllegalArgumentException If the operation is for a different Segment.
[ "Accepts", "the", "given", "operation", "as", "a", "Source", "Segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L599-L606
132,175
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.acceptAttributes
private void acceptAttributes(Collection<AttributeUpdate> attributeUpdates) { if (attributeUpdates == null) { return; } for (AttributeUpdate au : attributeUpdates) { this.attributeUpdates.put(au.getAttributeId(), au.getValue()); } }
java
private void acceptAttributes(Collection<AttributeUpdate> attributeUpdates) { if (attributeUpdates == null) { return; } for (AttributeUpdate au : attributeUpdates) { this.attributeUpdates.put(au.getAttributeId(), au.getValue()); } }
[ "private", "void", "acceptAttributes", "(", "Collection", "<", "AttributeUpdate", ">", "attributeUpdates", ")", "{", "if", "(", "attributeUpdates", "==", "null", ")", "{", "return", ";", "}", "for", "(", "AttributeUpdate", "au", ":", "attributeUpdates", ")", "...
Accepts a collection of AttributeUpdates in the metadata. @param attributeUpdates The Attribute updates to accept.
[ "Accepts", "a", "collection", "of", "AttributeUpdates", "in", "the", "metadata", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L613-L621
132,176
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.updateStorageState
void updateStorageState(long storageLength, boolean storageSealed, boolean deleted, boolean storageDeleted) { this.storageLength = storageLength; this.sealedInStorage = storageSealed; this.deleted = deleted; this.deletedInStorage = storageDeleted; this.isChanged = true; }
java
void updateStorageState(long storageLength, boolean storageSealed, boolean deleted, boolean storageDeleted) { this.storageLength = storageLength; this.sealedInStorage = storageSealed; this.deleted = deleted; this.deletedInStorage = storageDeleted; this.isChanged = true; }
[ "void", "updateStorageState", "(", "long", "storageLength", ",", "boolean", "storageSealed", ",", "boolean", "deleted", ",", "boolean", "storageDeleted", ")", "{", "this", ".", "storageLength", "=", "storageLength", ";", "this", ".", "sealedInStorage", "=", "stora...
Updates the transaction with the given state of the segment in storage. This method is only meant to be used during recovery mode when we need to restore the state of a segment. During normal operations, these values are set asynchronously by the Writer. @param storageLength The value to set as StorageLength. @param...
[ "Updates", "the", "transaction", "with", "the", "given", "state", "of", "the", "segment", "in", "storage", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L638-L644
132,177
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java
SegmentMetadataUpdateTransaction.apply
void apply(UpdateableSegmentMetadata target) { if (!this.isChanged) { // No changes made. return; } Preconditions.checkArgument(target.getId() == this.id, "Target Segment Id mismatch. Expected %s, given %s.", this.id, target.getId()); Precondition...
java
void apply(UpdateableSegmentMetadata target) { if (!this.isChanged) { // No changes made. return; } Preconditions.checkArgument(target.getId() == this.id, "Target Segment Id mismatch. Expected %s, given %s.", this.id, target.getId()); Precondition...
[ "void", "apply", "(", "UpdateableSegmentMetadata", "target", ")", "{", "if", "(", "!", "this", ".", "isChanged", ")", "{", "// No changes made.", "return", ";", "}", "Preconditions", ".", "checkArgument", "(", "target", ".", "getId", "(", ")", "==", "this", ...
Applies all the outstanding changes to the base SegmentMetadata object.
[ "Applies", "all", "the", "outstanding", "changes", "to", "the", "base", "SegmentMetadata", "object", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/SegmentMetadataUpdateTransaction.java#L649-L694
132,178
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/AbstractStreamMetadataStore.java
AbstractStreamMetadataStore.createScope
@Override public CompletableFuture<CreateScopeStatus> createScope(final String scopeName) { return getScope(scopeName).createScope().handle((result, ex) -> { if (ex == null) { return CreateScopeStatus.newBuilder().setStatus(CreateScopeStatus.Status.SUCCESS).build(); }...
java
@Override public CompletableFuture<CreateScopeStatus> createScope(final String scopeName) { return getScope(scopeName).createScope().handle((result, ex) -> { if (ex == null) { return CreateScopeStatus.newBuilder().setStatus(CreateScopeStatus.Status.SUCCESS).build(); }...
[ "@", "Override", "public", "CompletableFuture", "<", "CreateScopeStatus", ">", "createScope", "(", "final", "String", "scopeName", ")", "{", "return", "getScope", "(", "scopeName", ")", ".", "createScope", "(", ")", ".", "handle", "(", "(", "result", ",", "e...
Create a scope with given name. @param scopeName Name of scope to created. @return CreateScopeStatus future.
[ "Create", "a", "scope", "with", "given", "name", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/AbstractStreamMetadataStore.java#L209-L223
132,179
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/AbstractStreamMetadataStore.java
AbstractStreamMetadataStore.deleteScope
@Override public CompletableFuture<DeleteScopeStatus> deleteScope(final String scopeName) { return getScope(scopeName).deleteScope().handle((result, e) -> { Throwable ex = Exceptions.unwrap(e); if (ex == null) { return DeleteScopeStatus.newBuilder().setStatus(DeleteSc...
java
@Override public CompletableFuture<DeleteScopeStatus> deleteScope(final String scopeName) { return getScope(scopeName).deleteScope().handle((result, e) -> { Throwable ex = Exceptions.unwrap(e); if (ex == null) { return DeleteScopeStatus.newBuilder().setStatus(DeleteSc...
[ "@", "Override", "public", "CompletableFuture", "<", "DeleteScopeStatus", ">", "deleteScope", "(", "final", "String", "scopeName", ")", "{", "return", "getScope", "(", "scopeName", ")", ".", "deleteScope", "(", ")", ".", "handle", "(", "(", "result", ",", "e...
Delete a scope with given name. @param scopeName Name of scope to be deleted @return DeleteScopeStatus future.
[ "Delete", "a", "scope", "with", "given", "name", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/AbstractStreamMetadataStore.java#L231-L247
132,180
pravega/pravega
controller/src/main/java/io/pravega/controller/server/SegmentHelper.java
SegmentHelper.sealSegment
public CompletableFuture<Boolean> sealSegment(final String scope, final String stream, final long segmentId, String delegationToken, ...
java
public CompletableFuture<Boolean> sealSegment(final String scope, final String stream, final long segmentId, String delegationToken, ...
[ "public", "CompletableFuture", "<", "Boolean", ">", "sealSegment", "(", "final", "String", "scope", ",", "final", "String", "stream", ",", "final", "long", "segmentId", ",", "String", "delegationToken", ",", "final", "long", "clientRequestId", ")", "{", "final",...
This method sends segment sealed message for the specified segment. @param scope stream scope @param stream stream name @param segmentId number of segment to be sealed @param delegationToken the token to be presented to segmentstore. @param clientRequestId client-generated ...
[ "This", "method", "sends", "segment", "sealed", "message", "for", "the", "specified", "segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L276-L285
132,181
pravega/pravega
controller/src/main/java/io/pravega/controller/server/SegmentHelper.java
SegmentHelper.createTableSegment
public CompletableFuture<Boolean> createTableSegment(final String tableName, String delegationToken, final long clientRequestId) { final CompletableFuture<Boolean> result = new CompletableFuture<>()...
java
public CompletableFuture<Boolean> createTableSegment(final String tableName, String delegationToken, final long clientRequestId) { final CompletableFuture<Boolean> result = new CompletableFuture<>()...
[ "public", "CompletableFuture", "<", "Boolean", ">", "createTableSegment", "(", "final", "String", "tableName", ",", "String", "delegationToken", ",", "final", "long", "clientRequestId", ")", "{", "final", "CompletableFuture", "<", "Boolean", ">", "result", "=", "n...
This method sends a WireCommand to create a table segment. @param tableName Qualified table name. @param delegationToken The token to be presented to the segmentstore. @param clientRequestId Request id. @return A CompletableFuture that, when completed normally, will indicate the table segment creatio...
[ "This", "method", "sends", "a", "WireCommand", "to", "create", "a", "table", "segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L632-L683
132,182
pravega/pravega
controller/src/main/java/io/pravega/controller/server/SegmentHelper.java
SegmentHelper.deleteTableSegment
public CompletableFuture<Boolean> deleteTableSegment(final String tableName, final boolean mustBeEmpty, String delegationToken, final long clientRequ...
java
public CompletableFuture<Boolean> deleteTableSegment(final String tableName, final boolean mustBeEmpty, String delegationToken, final long clientRequ...
[ "public", "CompletableFuture", "<", "Boolean", ">", "deleteTableSegment", "(", "final", "String", "tableName", ",", "final", "boolean", "mustBeEmpty", ",", "String", "delegationToken", ",", "final", "long", "clientRequestId", ")", "{", "final", "CompletableFuture", ...
This method sends a WireCommand to delete a table segment. @param tableName Qualified table name. @param mustBeEmpty Flag to check if the table segment should be empty before deletion. @param delegationToken The token to be presented to the segmentstore. @param clientRequestId Request id. @re...
[ "This", "method", "sends", "a", "WireCommand", "to", "delete", "a", "table", "segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L696-L755
132,183
pravega/pravega
controller/src/main/java/io/pravega/controller/server/SegmentHelper.java
SegmentHelper.readTableKeys
public CompletableFuture<TableSegment.IteratorItem<TableKey<byte[]>>> readTableKeys(final String tableName, final int suggestedKeyCount, final IteratorS...
java
public CompletableFuture<TableSegment.IteratorItem<TableKey<byte[]>>> readTableKeys(final String tableName, final int suggestedKeyCount, final IteratorS...
[ "public", "CompletableFuture", "<", "TableSegment", ".", "IteratorItem", "<", "TableKey", "<", "byte", "[", "]", ">", ">", ">", "readTableKeys", "(", "final", "String", "tableName", ",", "final", "int", "suggestedKeyCount", ",", "final", "IteratorState", "state"...
The method sends a WireCommand to iterate over table keys. @param tableName Qualified table name. @param suggestedKeyCount Suggested number of {@link TableKey}s to be returned by the SegmentStore. @param state Last known state of the iterator. @param delegationToken The token to be presented to the segmentstore. @param...
[ "The", "method", "sends", "a", "WireCommand", "to", "iterate", "over", "table", "keys", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L1022-L1083
132,184
pravega/pravega
controller/src/main/java/io/pravega/controller/server/SegmentHelper.java
SegmentHelper.sendRequestAsync
private void sendRequestAsync(final WireCommand request, final ReplyProcessor replyProcessor, final CompletableFuture<?> resultFuture, final PravegaNodeUri uri) { try { // get connection for the segment store nod...
java
private void sendRequestAsync(final WireCommand request, final ReplyProcessor replyProcessor, final CompletableFuture<?> resultFuture, final PravegaNodeUri uri) { try { // get connection for the segment store nod...
[ "private", "void", "sendRequestAsync", "(", "final", "WireCommand", "request", ",", "final", "ReplyProcessor", "replyProcessor", ",", "final", "CompletableFuture", "<", "?", ">", "resultFuture", ",", "final", "PravegaNodeUri", "uri", ")", "{", "try", "{", "// get ...
This method takes a new connection from the pool and associates replyProcessor with that connection and sends the supplied request over that connection. It takes a resultFuture that is completed when the response from the store is processed successfully. If there is a failure in establishing connection or sending the r...
[ "This", "method", "takes", "a", "new", "connection", "from", "the", "pool", "and", "associates", "replyProcessor", "with", "that", "connection", "and", "sends", "the", "supplied", "request", "over", "that", "connection", ".", "It", "takes", "a", "resultFuture", ...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L1217-L1229
132,185
pravega/pravega
controller/src/main/java/io/pravega/controller/server/SegmentHelper.java
SegmentHelper.connectionCompleteCallback
private void connectionCompleteCallback(WireCommand request, CompletableFuture<?> resultFuture, ConnectionWrapper connection, Throwable e) { if (connection == null || e != null) { ConnectionFailedException cause = e != null ? new ConnectionFailedExceptio...
java
private void connectionCompleteCallback(WireCommand request, CompletableFuture<?> resultFuture, ConnectionWrapper connection, Throwable e) { if (connection == null || e != null) { ConnectionFailedException cause = e != null ? new ConnectionFailedExceptio...
[ "private", "void", "connectionCompleteCallback", "(", "WireCommand", "request", ",", "CompletableFuture", "<", "?", ">", "resultFuture", ",", "ConnectionWrapper", "connection", ",", "Throwable", "e", ")", "{", "if", "(", "connection", "==", "null", "||", "e", "!...
Connection completion callback method. This is invoked when the future returned by the connection pool completes. If it succeeded, we will have a connection object where send the request. If it failed, the resultFuture is failed with ConnectionFailedException. @param request request to send over to segment store. @para...
[ "Connection", "completion", "callback", "method", ".", "This", "is", "invoked", "when", "the", "future", "returned", "by", "the", "connection", "pool", "completes", ".", "If", "it", "succeeded", "we", "will", "have", "a", "connection", "object", "where", "send...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L1242-L1252
132,186
pravega/pravega
controller/src/main/java/io/pravega/controller/server/SegmentHelper.java
SegmentHelper.requestCompleteCallback
private void requestCompleteCallback(CompletableFuture<ConnectionWrapper> connectionFuture, Throwable e) { // when processing completes, return the connection back to connection manager asynchronously. // Note: If result future is complete, connectionFuture is d...
java
private void requestCompleteCallback(CompletableFuture<ConnectionWrapper> connectionFuture, Throwable e) { // when processing completes, return the connection back to connection manager asynchronously. // Note: If result future is complete, connectionFuture is d...
[ "private", "void", "requestCompleteCallback", "(", "CompletableFuture", "<", "ConnectionWrapper", ">", "connectionFuture", ",", "Throwable", "e", ")", "{", "// when processing completes, return the connection back to connection manager asynchronously.", "// Note: If result future is co...
Request Complete callback is invoked when the request is complete, either by sending and receiving a response from segment store or by way of failure of connection. This is responsible for returning the connection back to the connection pool. @param connectionFuture conection future that when completed successfully hol...
[ "Request", "Complete", "callback", "is", "invoked", "when", "the", "request", "is", "complete", "either", "by", "sending", "and", "receiving", "a", "response", "from", "segment", "store", "or", "by", "way", "of", "failure", "of", "connection", ".", "This", "...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L1261-L1279
132,187
pravega/pravega
common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java
ExecutorServiceHelpers.getThreadFactory
public static ThreadFactory getThreadFactory(String groupName) { return new ThreadFactory() { final AtomicInteger threadCount = new AtomicInteger(); @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r, groupName + "-" + threadCount.in...
java
public static ThreadFactory getThreadFactory(String groupName) { return new ThreadFactory() { final AtomicInteger threadCount = new AtomicInteger(); @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r, groupName + "-" + threadCount.in...
[ "public", "static", "ThreadFactory", "getThreadFactory", "(", "String", "groupName", ")", "{", "return", "new", "ThreadFactory", "(", ")", "{", "final", "AtomicInteger", "threadCount", "=", "new", "AtomicInteger", "(", ")", ";", "@", "Override", "public", "Threa...
Creates and returns a thread factory that will create threads with the given name prefix. @param groupName the name of the threads @return a thread factory
[ "Creates", "and", "returns", "a", "thread", "factory", "that", "will", "create", "threads", "with", "the", "given", "name", "prefix", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java#L52-L63
132,188
pravega/pravega
common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java
ExecutorServiceHelpers.newScheduledThreadPool
public static ScheduledExecutorService newScheduledThreadPool(int size, String poolName) { // Caller runs only occurs after shutdown, as queue size is unbounded. ScheduledThreadPoolExecutor result = new ScheduledThreadPoolExecutor(size, getThreadFactory(poolName), new CallerRuns()); // Do not e...
java
public static ScheduledExecutorService newScheduledThreadPool(int size, String poolName) { // Caller runs only occurs after shutdown, as queue size is unbounded. ScheduledThreadPoolExecutor result = new ScheduledThreadPoolExecutor(size, getThreadFactory(poolName), new CallerRuns()); // Do not e...
[ "public", "static", "ScheduledExecutorService", "newScheduledThreadPool", "(", "int", "size", ",", "String", "poolName", ")", "{", "// Caller runs only occurs after shutdown, as queue size is unbounded.", "ScheduledThreadPoolExecutor", "result", "=", "new", "ScheduledThreadPoolExec...
Creates a new ScheduledExecutorService that will use daemon threads with appropriate names the threads. @param size The number of threads in the threadpool @param poolName The name of the pool (this will be printed in logs) @return A new executor service.
[ "Creates", "a", "new", "ScheduledExecutorService", "that", "will", "use", "daemon", "threads", "with", "appropriate", "names", "the", "threads", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java#L71-L85
132,189
pravega/pravega
common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java
ExecutorServiceHelpers.getSnapshot
public static Snapshot getSnapshot(ExecutorService service) { Preconditions.checkNotNull(service, "service"); if (service instanceof ThreadPoolExecutor) { val tpe = (ThreadPoolExecutor) service; return new Snapshot(tpe.getQueue().size(), tpe.getActiveCount(), tpe.getPoolSize()); ...
java
public static Snapshot getSnapshot(ExecutorService service) { Preconditions.checkNotNull(service, "service"); if (service instanceof ThreadPoolExecutor) { val tpe = (ThreadPoolExecutor) service; return new Snapshot(tpe.getQueue().size(), tpe.getActiveCount(), tpe.getPoolSize()); ...
[ "public", "static", "Snapshot", "getSnapshot", "(", "ExecutorService", "service", ")", "{", "Preconditions", ".", "checkNotNull", "(", "service", ",", "\"service\"", ")", ";", "if", "(", "service", "instanceof", "ThreadPoolExecutor", ")", "{", "val", "tpe", "=",...
Gets a snapshot of the given ExecutorService. @param service The ExecutorService to request a snapshot on. @return A Snapshot of the given ExecutorService, or null if not supported.
[ "Gets", "a", "snapshot", "of", "the", "given", "ExecutorService", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java#L93-L104
132,190
pravega/pravega
common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java
ExecutorServiceHelpers.getShrinkingExecutor
public static ThreadPoolExecutor getShrinkingExecutor(int maxThreadCount, int threadTimeout, String poolName) { return new ThreadPoolExecutor(0, maxThreadCount, threadTimeout, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), getThreadFactory(poolName), new CallerRuns()); // Caller runs only o...
java
public static ThreadPoolExecutor getShrinkingExecutor(int maxThreadCount, int threadTimeout, String poolName) { return new ThreadPoolExecutor(0, maxThreadCount, threadTimeout, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), getThreadFactory(poolName), new CallerRuns()); // Caller runs only o...
[ "public", "static", "ThreadPoolExecutor", "getShrinkingExecutor", "(", "int", "maxThreadCount", ",", "int", "threadTimeout", ",", "String", "poolName", ")", "{", "return", "new", "ThreadPoolExecutor", "(", "0", ",", "maxThreadCount", ",", "threadTimeout", ",", "Time...
Operates like Executors.cachedThreadPool but with a custom thread timeout and pool name. @return A new threadPool @param maxThreadCount The maximum number of threads to allow in the pool. @param threadTimeout the number of milliseconds that a thread should sit idle before shutting down. @param poolName The name of the ...
[ "Operates", "like", "Executors", ".", "cachedThreadPool", "but", "with", "a", "custom", "thread", "timeout", "and", "pool", "name", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java#L113-L116
132,191
pravega/pravega
common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java
ExecutorServiceHelpers.execute
public static void execute(RunnableWithException task, Consumer<Throwable> exceptionHandler, Runnable runFinally, Executor executor) { Preconditions.checkNotNull(task, "task"); Preconditions.checkNotNull(exceptionHandler, "exceptionHandler"); Preconditions.checkNotNull(runFinally, "runFinally");...
java
public static void execute(RunnableWithException task, Consumer<Throwable> exceptionHandler, Runnable runFinally, Executor executor) { Preconditions.checkNotNull(task, "task"); Preconditions.checkNotNull(exceptionHandler, "exceptionHandler"); Preconditions.checkNotNull(runFinally, "runFinally");...
[ "public", "static", "void", "execute", "(", "RunnableWithException", "task", ",", "Consumer", "<", "Throwable", ">", "exceptionHandler", ",", "Runnable", "runFinally", ",", "Executor", "executor", ")", "{", "Preconditions", ".", "checkNotNull", "(", "task", ",", ...
Executes the given task on the given Executor. @param task The RunnableWithException to execute. @param exceptionHandler A Consumer that will be invoked in case the task threw an Exception. This is not invoked if the executor could not execute the given task. @param runFinally A Runnable that is guar...
[ "Executes", "the", "given", "task", "on", "the", "given", "Executor", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java#L129-L157
132,192
pravega/pravega
common/src/main/java/io/pravega/common/util/DelimitedStringParser.java
DelimitedStringParser.parser
public static DelimitedStringParser parser(String pairDelimiter, String keyValueDelimiter) { Exceptions.checkNotNullOrEmpty(pairDelimiter, "pairDelimiter"); Exceptions.checkNotNullOrEmpty(keyValueDelimiter, "keyValueDelimiter"); Preconditions.checkArgument(!pairDelimiter.equals(keyValueDelimiter...
java
public static DelimitedStringParser parser(String pairDelimiter, String keyValueDelimiter) { Exceptions.checkNotNullOrEmpty(pairDelimiter, "pairDelimiter"); Exceptions.checkNotNullOrEmpty(keyValueDelimiter, "keyValueDelimiter"); Preconditions.checkArgument(!pairDelimiter.equals(keyValueDelimiter...
[ "public", "static", "DelimitedStringParser", "parser", "(", "String", "pairDelimiter", ",", "String", "keyValueDelimiter", ")", "{", "Exceptions", ".", "checkNotNullOrEmpty", "(", "pairDelimiter", ",", "\"pairDelimiter\"", ")", ";", "Exceptions", ".", "checkNotNullOrEmp...
Creates a new DelimitedStringParser with the given Pair and KeyValue delimiters. @param pairDelimiter A String that will be used to delimit pairs. @param keyValueDelimiter A String that will be used to delimit Keys from Values (inside a pair). @return A new instance of the DelimitedStringParser class.
[ "Creates", "a", "new", "DelimitedStringParser", "with", "the", "given", "Pair", "and", "KeyValue", "delimiters", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/DelimitedStringParser.java#L66-L72
132,193
pravega/pravega
common/src/main/java/io/pravega/common/util/DelimitedStringParser.java
DelimitedStringParser.parse
public void parse(String s) { Preconditions.checkNotNull(s, "s"); if (s.length() == 0) { // Nothing to do. return; } val pairs = s.split(pairDelimiter); for (String pair : pairs) { int delimiterPos = pair.indexOf(keyValueDelimiter); ...
java
public void parse(String s) { Preconditions.checkNotNull(s, "s"); if (s.length() == 0) { // Nothing to do. return; } val pairs = s.split(pairDelimiter); for (String pair : pairs) { int delimiterPos = pair.indexOf(keyValueDelimiter); ...
[ "public", "void", "parse", "(", "String", "s", ")", "{", "Preconditions", ".", "checkNotNull", "(", "s", ",", "\"s\"", ")", ";", "if", "(", "s", ".", "length", "(", ")", "==", "0", ")", "{", "// Nothing to do.", "return", ";", "}", "val", "pairs", ...
Parses the given string using the configuration set on this parser. @param s The string to parse.
[ "Parses", "the", "given", "string", "using", "the", "configuration", "set", "on", "this", "parser", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/DelimitedStringParser.java#L143-L169
132,194
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java
PravegaTablesStoreHelper.getCachedData
public <T> CompletableFuture<VersionedMetadata<T>> getCachedData(String table, String key, Function<byte[], T> fromBytes) { return cache.getCachedData(new TableCacheKey<>(table, key, fromBytes)) .thenApply(this::getVersionedMetadata); }
java
public <T> CompletableFuture<VersionedMetadata<T>> getCachedData(String table, String key, Function<byte[], T> fromBytes) { return cache.getCachedData(new TableCacheKey<>(table, key, fromBytes)) .thenApply(this::getVersionedMetadata); }
[ "public", "<", "T", ">", "CompletableFuture", "<", "VersionedMetadata", "<", "T", ">", ">", "getCachedData", "(", "String", "table", ",", "String", "key", ",", "Function", "<", "byte", "[", "]", ",", "T", ">", "fromBytes", ")", "{", "return", "cache", ...
Api to read cached value for the specified key from the requested table. @param table name of table @param key key to query @param fromBytes deserialization function. @param <T> Type of object to deserialize the response into. @return Returns a completableFuture which when completed will have the deserialized value wit...
[ "Api", "to", "read", "cached", "value", "for", "the", "specified", "key", "from", "the", "requested", "table", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L98-L101
132,195
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java
PravegaTablesStoreHelper.invalidateCache
public void invalidateCache(String table, String key) { cache.invalidateCache(new TableCacheKey<>(table, key, x -> null)); }
java
public void invalidateCache(String table, String key) { cache.invalidateCache(new TableCacheKey<>(table, key, x -> null)); }
[ "public", "void", "invalidateCache", "(", "String", "table", ",", "String", "key", ")", "{", "cache", ".", "invalidateCache", "(", "new", "TableCacheKey", "<>", "(", "table", ",", "key", ",", "x", "->", "null", ")", ")", ";", "}" ]
Method to invalidate cached value in the cache for the specified table. @param table table name @param key key to invalidate
[ "Method", "to", "invalidate", "cached", "value", "in", "the", "cache", "for", "the", "specified", "table", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L115-L117
132,196
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java
PravegaTablesStoreHelper.createTable
public CompletableFuture<Void> createTable(String tableName) { log.debug("create table called for table: {}", tableName); return Futures.toVoid(withRetries(() -> segmentHelper.createTableSegment(tableName, authToken.get(), RequestTag.NON_EXISTENT_ID), () -> String.format("create table: ...
java
public CompletableFuture<Void> createTable(String tableName) { log.debug("create table called for table: {}", tableName); return Futures.toVoid(withRetries(() -> segmentHelper.createTableSegment(tableName, authToken.get(), RequestTag.NON_EXISTENT_ID), () -> String.format("create table: ...
[ "public", "CompletableFuture", "<", "Void", ">", "createTable", "(", "String", "tableName", ")", "{", "log", ".", "debug", "(", "\"create table called for table: {}\"", ",", "tableName", ")", ";", "return", "Futures", ".", "toVoid", "(", "withRetries", "(", "(",...
Method to create a new Table. If the table already exists, segment helper responds with success. @param tableName table name @return CompletableFuture which when completed will indicate successful creation of table.
[ "Method", "to", "create", "a", "new", "Table", ".", "If", "the", "table", "already", "exists", "segment", "helper", "responds", "with", "success", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L124-L136
132,197
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java
PravegaTablesStoreHelper.addNewEntriesIfAbsent
public CompletableFuture<Void> addNewEntriesIfAbsent(String tableName, Map<String, byte[]> toAdd) { List<TableEntry<byte[], byte[]>> entries = toAdd.entrySet().stream().map(x -> new TableEntryImpl<>(new TableKeyImpl<>(x.getKey().getBytes(Charsets.UTF_8), KeyVersion.NOT_EXISTS), x.getValue())) ...
java
public CompletableFuture<Void> addNewEntriesIfAbsent(String tableName, Map<String, byte[]> toAdd) { List<TableEntry<byte[], byte[]>> entries = toAdd.entrySet().stream().map(x -> new TableEntryImpl<>(new TableKeyImpl<>(x.getKey().getBytes(Charsets.UTF_8), KeyVersion.NOT_EXISTS), x.getValue())) ...
[ "public", "CompletableFuture", "<", "Void", ">", "addNewEntriesIfAbsent", "(", "String", "tableName", ",", "Map", "<", "String", ",", "byte", "[", "]", ">", "toAdd", ")", "{", "List", "<", "TableEntry", "<", "byte", "[", "]", ",", "byte", "[", "]", ">"...
Method to add a batch of entries if absent. Table implementation on segment store guarantees that either all or none of the entries are added. If segment store responds with success, then it is guaranteed that all entries are added to the store. However, it is important to note that the segment store could respond with...
[ "Method", "to", "add", "a", "batch", "of", "entries", "if", "absent", ".", "Table", "implementation", "on", "segment", "store", "guarantees", "that", "either", "all", "or", "none", "of", "the", "entries", "are", "added", ".", "If", "segment", "store", "res...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L212-L233
132,198
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java
PravegaTablesStoreHelper.updateEntry
public CompletableFuture<Version> updateEntry(String tableName, String key, byte[] value, Version ver) { log.trace("updateEntry entry called for : {} key : {} version {}", tableName, key, ver.asLongVersion().getLongValue()); KeyVersionImpl version = new KeyVersionImpl(ver.asLongVersion().getLongValue()...
java
public CompletableFuture<Version> updateEntry(String tableName, String key, byte[] value, Version ver) { log.trace("updateEntry entry called for : {} key : {} version {}", tableName, key, ver.asLongVersion().getLongValue()); KeyVersionImpl version = new KeyVersionImpl(ver.asLongVersion().getLongValue()...
[ "public", "CompletableFuture", "<", "Version", ">", "updateEntry", "(", "String", "tableName", ",", "String", "key", ",", "byte", "[", "]", "value", ",", "Version", "ver", ")", "{", "log", ".", "trace", "(", "\"updateEntry entry called for : {} key : {} version {}...
Method to update a single entry. @param tableName tablename @param key key @param value value @param ver previous key version @return CompletableFuture which when completed will indicate that the value is updated in the table.
[ "Method", "to", "update", "a", "single", "entry", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L243-L257
132,199
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java
PravegaTablesStoreHelper.removeEntry
public CompletableFuture<Void> removeEntry(String tableName, String key) { log.trace("remove entry called for : {} key : {}", tableName, key); List<TableKey<byte[]>> keys = Collections.singletonList(new TableKeyImpl<>(key.getBytes(Charsets.UTF_8), null)); return expectingDataNotFound(withRetrie...
java
public CompletableFuture<Void> removeEntry(String tableName, String key) { log.trace("remove entry called for : {} key : {}", tableName, key); List<TableKey<byte[]>> keys = Collections.singletonList(new TableKeyImpl<>(key.getBytes(Charsets.UTF_8), null)); return expectingDataNotFound(withRetrie...
[ "public", "CompletableFuture", "<", "Void", ">", "removeEntry", "(", "String", "tableName", ",", "String", "key", ")", "{", "log", ".", "trace", "(", "\"remove entry called for : {} key : {}\"", ",", "tableName", ",", "key", ")", ";", "List", "<", "TableKey", ...
Method to remove entry from the store. @param tableName tableName @param key key @return CompletableFuture which when completed will indicate successful deletion of entry from the table. It ignores DataNotFound exception.
[ "Method", "to", "remove", "entry", "from", "the", "store", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PravegaTablesStoreHelper.java#L305-L313