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
131,900
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/Write.java
Write.complete
Timer complete() { Preconditions.checkState(this.entryId.get() >= 0, "entryId not set; cannot complete Write."); this.failureCause.set(null); this.result.complete(new LedgerAddress(this.writeLedger.get().metadata, this.entryId.get())); return endAttempt(); }
java
Timer complete() { Preconditions.checkState(this.entryId.get() >= 0, "entryId not set; cannot complete Write."); this.failureCause.set(null); this.result.complete(new LedgerAddress(this.writeLedger.get().metadata, this.entryId.get())); return endAttempt(); }
[ "Timer", "complete", "(", ")", "{", "Preconditions", ".", "checkState", "(", "this", ".", "entryId", ".", "get", "(", ")", ">=", "0", ",", "\"entryId not set; cannot complete Write.\"", ")", ";", "this", ".", "failureCause", ".", "set", "(", "null", ")", "...
Indicates that this write completed successfully. This will set the final result on the externalCompletion future.
[ "Indicates", "that", "this", "write", "completed", "successfully", ".", "This", "will", "set", "the", "final", "result", "on", "the", "externalCompletion", "future", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/Write.java#L151-L156
131,901
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/Write.java
Write.fail
void fail(Throwable cause, boolean complete) { if (cause != null) { Throwable e = this.failureCause.get(); if (e != null && e != cause) { cause.addSuppressed(e); } this.failureCause.set(cause); } endAttempt(); WriteLedger ...
java
void fail(Throwable cause, boolean complete) { if (cause != null) { Throwable e = this.failureCause.get(); if (e != null && e != cause) { cause.addSuppressed(e); } this.failureCause.set(cause); } endAttempt(); WriteLedger ...
[ "void", "fail", "(", "Throwable", "cause", ",", "boolean", "complete", ")", "{", "if", "(", "cause", "!=", "null", ")", "{", "Throwable", "e", "=", "this", ".", "failureCause", ".", "get", "(", ")", ";", "if", "(", "e", "!=", "null", "&&", "e", "...
Indicates that this write failed. @param cause The failure cause. If null, the previous failure cause is preserved. @param complete If true, the externalCompletion will be immediately be completed with the current failure cause. If false, no completion will be done.
[ "Indicates", "that", "this", "write", "failed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/Write.java#L165-L185
131,902
pravega/pravega
controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java
CommitRequestHandler.execute
@Override public CompletableFuture<Void> execute(CommitEvent event) { String scope = event.getScope(); String stream = event.getStream(); OperationContext context = streamMetadataStore.createContext(scope, stream); log.debug("Attempting to commit available transactions on stream {}/{...
java
@Override public CompletableFuture<Void> execute(CommitEvent event) { String scope = event.getScope(); String stream = event.getStream(); OperationContext context = streamMetadataStore.createContext(scope, stream); log.debug("Attempting to commit available transactions on stream {}/{...
[ "@", "Override", "public", "CompletableFuture", "<", "Void", ">", "execute", "(", "CommitEvent", "event", ")", "{", "String", "scope", "=", "event", ".", "getScope", "(", ")", ";", "String", "stream", "=", "event", ".", "getStream", "(", ")", ";", "Opera...
This method attempts to collect all transactions in the epoch that are marked for commit and decides if they can be committed in active epoch or if it needs to roll the transactions. @param event event to process @return Completable future which indicates completion of processing of commit event.
[ "This", "method", "attempts", "to", "collect", "all", "transactions", "in", "the", "epoch", "that", "are", "marked", "for", "commit", "and", "decides", "if", "they", "can", "be", "committed", "in", "active", "epoch", "or", "if", "it", "needs", "to", "roll"...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java#L85-L125
131,903
pravega/pravega
controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java
CommitRequestHandler.tryCommitTransactions
private CompletableFuture<Integer> tryCommitTransactions(final String scope, final String stream, final OperationContext context) { return streamMetadataStore.getVersionedState(scope, stream, cont...
java
private CompletableFuture<Integer> tryCommitTransactions(final String scope, final String stream, final OperationContext context) { return streamMetadataStore.getVersionedState(scope, stream, cont...
[ "private", "CompletableFuture", "<", "Integer", ">", "tryCommitTransactions", "(", "final", "String", "scope", ",", "final", "String", "stream", ",", "final", "OperationContext", "context", ")", "{", "return", "streamMetadataStore", ".", "getVersionedState", "(", "s...
Try creating txn commit list first. if node already exists and doesn't match the processing in the event, throw operation not allowed. This will result in event being posted back in the stream and retried later. Generally if a transaction commit starts, it will come to an end. However, during failover, once we have cre...
[ "Try", "creating", "txn", "commit", "list", "first", ".", "if", "node", "already", "exists", "and", "doesn", "t", "match", "the", "processing", "in", "the", "event", "throw", "operation", "not", "allowed", ".", "This", "will", "result", "in", "event", "bei...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java#L134-L194
131,904
pravega/pravega
controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java
CommitRequestHandler.copyTxnEpochSegmentsAndCommitTxns
private CompletableFuture<Void> copyTxnEpochSegmentsAndCommitTxns(String scope, String stream, List<UUID> transactionsToCommit, List<Long> segmentIds) { // 1. create duplicate segments // 2. merge transactions in those segments ...
java
private CompletableFuture<Void> copyTxnEpochSegmentsAndCommitTxns(String scope, String stream, List<UUID> transactionsToCommit, List<Long> segmentIds) { // 1. create duplicate segments // 2. merge transactions in those segments ...
[ "private", "CompletableFuture", "<", "Void", ">", "copyTxnEpochSegmentsAndCommitTxns", "(", "String", "scope", ",", "String", "stream", ",", "List", "<", "UUID", ">", "transactionsToCommit", ",", "List", "<", "Long", ">", "segmentIds", ")", "{", "// 1. create dupl...
This method is called in the rolling transaction flow. This method creates duplicate segments for transaction epoch. It then merges all transactions from the list into those duplicate segments.
[ "This", "method", "is", "called", "in", "the", "rolling", "transaction", "flow", ".", "This", "method", "creates", "duplicate", "segments", "for", "transaction", "epoch", ".", "It", "then", "merges", "all", "transactions", "from", "the", "list", "into", "those...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java#L253-L272
131,905
pravega/pravega
controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java
CommitRequestHandler.commitTransactions
private CompletableFuture<Void> commitTransactions(String scope, String stream, List<Long> segments, List<UUID> transactionsToCommit) { // Chain all transaction commit futures one after the other. This will ensure that order of commit ...
java
private CompletableFuture<Void> commitTransactions(String scope, String stream, List<Long> segments, List<UUID> transactionsToCommit) { // Chain all transaction commit futures one after the other. This will ensure that order of commit ...
[ "private", "CompletableFuture", "<", "Void", ">", "commitTransactions", "(", "String", "scope", ",", "String", "stream", ",", "List", "<", "Long", ">", "segments", ",", "List", "<", "UUID", ">", "transactionsToCommit", ")", "{", "// Chain all transaction commit fu...
This method loops over each transaction in the list, and commits them in order At the end of this method's execution, all transactions in the list would have committed into given list of segments.
[ "This", "method", "loops", "over", "each", "transaction", "in", "the", "list", "and", "commits", "them", "in", "order", "At", "the", "end", "of", "this", "method", "s", "execution", "all", "transactions", "in", "the", "list", "would", "have", "committed", ...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java#L278-L294
131,906
pravega/pravega
controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java
CommitRequestHandler.getEpochRecords
private CompletableFuture<List<EpochRecord>> getEpochRecords(String scope, String stream, int epoch, OperationContext context) { List<CompletableFuture<EpochRecord>> list = new ArrayList<>(); list.add(streamMetadataStore.getEpoch(scope, stream, epoch, context, executor)); list.add(streamMetadata...
java
private CompletableFuture<List<EpochRecord>> getEpochRecords(String scope, String stream, int epoch, OperationContext context) { List<CompletableFuture<EpochRecord>> list = new ArrayList<>(); list.add(streamMetadataStore.getEpoch(scope, stream, epoch, context, executor)); list.add(streamMetadata...
[ "private", "CompletableFuture", "<", "List", "<", "EpochRecord", ">", ">", "getEpochRecords", "(", "String", "scope", ",", "String", "stream", ",", "int", "epoch", ",", "OperationContext", "context", ")", "{", "List", "<", "CompletableFuture", "<", "EpochRecord"...
Fetches epoch history records for active epoch and the supplied `epoch` from the store.
[ "Fetches", "epoch", "history", "records", "for", "active", "epoch", "and", "the", "supplied", "epoch", "from", "the", "store", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java#L299-L304
131,907
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.close
void close(boolean cleanCache) { if (!this.closed) { this.closed = true; // Close storage reader (and thus cancel those reads). this.storageReadManager.close(); // Cancel registered future reads and any reads pertaining to incomplete mergers. ArrayLi...
java
void close(boolean cleanCache) { if (!this.closed) { this.closed = true; // Close storage reader (and thus cancel those reads). this.storageReadManager.close(); // Cancel registered future reads and any reads pertaining to incomplete mergers. ArrayLi...
[ "void", "close", "(", "boolean", "cleanCache", ")", "{", "if", "(", "!", "this", ".", "closed", ")", "{", "this", ".", "closed", "=", "true", ";", "// Close storage reader (and thus cancel those reads).", "this", ".", "storageReadManager", ".", "close", "(", "...
Closes the ReadIndex and optionally cleans the cache. @param cleanCache If true, the Cache will be cleaned up of all ReadIndexEntries pertaining to this ReadIndex. If false, the Cache will not be touched.
[ "Closes", "the", "ReadIndex", "and", "optionally", "cleans", "the", "cache", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L136-L160
131,908
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.removeAllEntries
private void removeAllEntries() { // A bit unusual, but we want to make sure we do not call this while the index is active. Preconditions.checkState(this.closed, "Cannot call removeAllEntries unless the ReadIndex is closed."); int count; synchronized (this.lock) { this.indexE...
java
private void removeAllEntries() { // A bit unusual, but we want to make sure we do not call this while the index is active. Preconditions.checkState(this.closed, "Cannot call removeAllEntries unless the ReadIndex is closed."); int count; synchronized (this.lock) { this.indexE...
[ "private", "void", "removeAllEntries", "(", ")", "{", "// A bit unusual, but we want to make sure we do not call this while the index is active.", "Preconditions", ".", "checkState", "(", "this", ".", "closed", ",", "\"Cannot call removeAllEntries unless the ReadIndex is closed.\"", ...
Removes all entries from the cache and the SortedIndex, regardless of their state. @throws IllegalStateException If the StreamSegmentReadIndex is not closed.
[ "Removes", "all", "entries", "from", "the", "cache", "and", "the", "SortedIndex", "regardless", "of", "their", "state", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L177-L196
131,909
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.markMerged
void markMerged() { Exceptions.checkNotClosed(this.closed, this); Preconditions.checkState(!this.merged, "StreamSegmentReadIndex %d is already merged.", this.metadata.getId()); log.debug("{}: Merged.", this.traceObjectId); this.merged = true; }
java
void markMerged() { Exceptions.checkNotClosed(this.closed, this); Preconditions.checkState(!this.merged, "StreamSegmentReadIndex %d is already merged.", this.metadata.getId()); log.debug("{}: Merged.", this.traceObjectId); this.merged = true; }
[ "void", "markMerged", "(", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ",", "this", ")", ";", "Preconditions", ".", "checkState", "(", "!", "this", ".", "merged", ",", "\"StreamSegmentReadIndex %d is already merged.\"", ",", "this"...
Marks this Read Index as merged into another one.
[ "Marks", "this", "Read", "Index", "as", "merged", "into", "another", "one", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L270-L275
131,910
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.append
void append(long offset, byte[] data) { Exceptions.checkNotClosed(this.closed, this); Preconditions.checkState(!isMerged(), "StreamSegment has been merged into a different one. Cannot append more ReadIndex entries."); if (data.length == 0) { // Nothing to do. Adding empty read entri...
java
void append(long offset, byte[] data) { Exceptions.checkNotClosed(this.closed, this); Preconditions.checkState(!isMerged(), "StreamSegment has been merged into a different one. Cannot append more ReadIndex entries."); if (data.length == 0) { // Nothing to do. Adding empty read entri...
[ "void", "append", "(", "long", "offset", ",", "byte", "[", "]", "data", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ",", "this", ")", ";", "Preconditions", ".", "checkState", "(", "!", "isMerged", "(", ")", ",", "\"Stream...
Appends the given range of bytes at the given offset. @param offset The offset within the StreamSegment to append at. @param data The range of bytes to append. @throws NullPointerException If data is null. @throws IllegalArgumentException If the operation would cause writing beyond the StreamSegment's Length. @t...
[ "Appends", "the", "given", "range", "of", "bytes", "at", "the", "given", "offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L336-L356
131,911
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.completeMerge
void completeMerge(SegmentMetadata sourceMetadata) { long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "completeMerge", sourceMetadata.getId()); Exceptions.checkNotClosed(this.closed, this); Exceptions.checkArgument(sourceMetadata.isDeleted(), "sourceSegmentStreamId", ...
java
void completeMerge(SegmentMetadata sourceMetadata) { long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "completeMerge", sourceMetadata.getId()); Exceptions.checkNotClosed(this.closed, this); Exceptions.checkArgument(sourceMetadata.isDeleted(), "sourceSegmentStreamId", ...
[ "void", "completeMerge", "(", "SegmentMetadata", "sourceMetadata", ")", "{", "long", "traceId", "=", "LoggerHelpers", ".", "traceEnterWithContext", "(", "log", ",", "this", ".", "traceObjectId", ",", "\"completeMerge\"", ",", "sourceMetadata", ".", "getId", "(", "...
Executes Step 2 of the 2-Step Merge Process. The StreamSegments are physically merged in the Storage. The Source StreamSegment does not exist anymore. The ReadIndex entries of the two Streams are actually joined together. @param sourceMetadata The SegmentMetadata of the Segment that was merged into this one.
[ "Executes", "Step", "2", "of", "the", "2", "-", "Step", "Merge", "Process", ".", "The", "StreamSegments", "are", "physically", "merged", "in", "the", "Storage", ".", "The", "Source", "StreamSegment", "does", "not", "exist", "anymore", ".", "The", "ReadIndex"...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L423-L471
131,912
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.triggerFutureReads
void triggerFutureReads() { Exceptions.checkNotClosed(this.closed, this); Preconditions.checkState(!this.recoveryMode, "StreamSegmentReadIndex is in Recovery Mode."); boolean sealed = this.metadata.isSealed(); Collection<FutureReadResultEntry> futureReads; if (sealed) { ...
java
void triggerFutureReads() { Exceptions.checkNotClosed(this.closed, this); Preconditions.checkState(!this.recoveryMode, "StreamSegmentReadIndex is in Recovery Mode."); boolean sealed = this.metadata.isSealed(); Collection<FutureReadResultEntry> futureReads; if (sealed) { ...
[ "void", "triggerFutureReads", "(", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ",", "this", ")", ";", "Preconditions", ".", "checkState", "(", "!", "this", ".", "recoveryMode", ",", "\"StreamSegmentReadIndex is in Recovery Mode.\"", ...
Triggers all future reads that have a starting offset before the given value. @throws IllegalStateException If the read index is in recovery mode.
[ "Triggers", "all", "future", "reads", "that", "have", "a", "starting", "offset", "before", "the", "given", "value", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L542-L571
131,913
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.triggerFutureReads
private void triggerFutureReads(Collection<FutureReadResultEntry> futureReads) { for (FutureReadResultEntry r : futureReads) { ReadResultEntry entry = getSingleReadResultEntry(r.getStreamSegmentOffset(), r.getRequestedReadLength()); assert entry != null : "Serving a StorageReadResultEntr...
java
private void triggerFutureReads(Collection<FutureReadResultEntry> futureReads) { for (FutureReadResultEntry r : futureReads) { ReadResultEntry entry = getSingleReadResultEntry(r.getStreamSegmentOffset(), r.getRequestedReadLength()); assert entry != null : "Serving a StorageReadResultEntr...
[ "private", "void", "triggerFutureReads", "(", "Collection", "<", "FutureReadResultEntry", ">", "futureReads", ")", "{", "for", "(", "FutureReadResultEntry", "r", ":", "futureReads", ")", "{", "ReadResultEntry", "entry", "=", "getSingleReadResultEntry", "(", "r", "."...
Triggers all the Future Reads in the given collection. @param futureReads The Future Reads to trigger.
[ "Triggers", "all", "the", "Future", "Reads", "in", "the", "given", "collection", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L578-L604
131,914
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.read
ReadResult read(long startOffset, int maxLength, Duration timeout) { Exceptions.checkNotClosed(this.closed, this); Preconditions.checkState(!this.recoveryMode, "StreamSegmentReadIndex is in Recovery Mode."); Exceptions.checkArgument(startOffset >= 0, "startOffset", "startOffset must be a non-neg...
java
ReadResult read(long startOffset, int maxLength, Duration timeout) { Exceptions.checkNotClosed(this.closed, this); Preconditions.checkState(!this.recoveryMode, "StreamSegmentReadIndex is in Recovery Mode."); Exceptions.checkArgument(startOffset >= 0, "startOffset", "startOffset must be a non-neg...
[ "ReadResult", "read", "(", "long", "startOffset", ",", "int", "maxLength", ",", "Duration", "timeout", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ",", "this", ")", ";", "Preconditions", ".", "checkState", "(", "!", "this", "...
Reads a range of bytes from the StreamSegment. @param startOffset The offset in the StreamSegment where to start reading. @param maxLength The maximum number of bytes to read. @param timeout Timeout for the operation. @return A ReadResult containing methods for retrieving the result. @throws IllegalStateExceptio...
[ "Reads", "a", "range", "of", "bytes", "from", "the", "StreamSegment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L683-L696
131,915
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.checkReadAvailability
private ReadAvailability checkReadAvailability(long offset, boolean lastOffsetInclusive) { // We can only read at a particular offset if: // * The offset is not before the Segment's StartOffset // AND // * The segment is not sealed (we are allowed to do a future read) OR // * The...
java
private ReadAvailability checkReadAvailability(long offset, boolean lastOffsetInclusive) { // We can only read at a particular offset if: // * The offset is not before the Segment's StartOffset // AND // * The segment is not sealed (we are allowed to do a future read) OR // * The...
[ "private", "ReadAvailability", "checkReadAvailability", "(", "long", "offset", ",", "boolean", "lastOffsetInclusive", ")", "{", "// We can only read at a particular offset if:", "// * The offset is not before the Segment's StartOffset", "// AND", "// * The segment is not sealed (we are a...
Determines the availability of reading at a particular offset, given the state of a segment. @param offset The offset to check. @param lastOffsetInclusive If true, it will consider the last offset of the segment as a valid offset, otherwise it will only validate offsets before the last offset in the segme...
[ "Determines", "the", "availability", "of", "reading", "at", "a", "particular", "offset", "given", "the", "state", "of", "a", "segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L707-L723
131,916
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.getSingleReadResultEntry
private CompletableReadResultEntry getSingleReadResultEntry(long resultStartOffset, int maxLength) { Exceptions.checkNotClosed(this.closed, this); if (maxLength < 0) { // Nothing to read. return null; } CompletableReadResultEntry result = null; // Check ...
java
private CompletableReadResultEntry getSingleReadResultEntry(long resultStartOffset, int maxLength) { Exceptions.checkNotClosed(this.closed, this); if (maxLength < 0) { // Nothing to read. return null; } CompletableReadResultEntry result = null; // Check ...
[ "private", "CompletableReadResultEntry", "getSingleReadResultEntry", "(", "long", "resultStartOffset", ",", "int", "maxLength", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ",", "this", ")", ";", "if", "(", "maxLength", "<", "0", ")...
Returns the first ReadResultEntry that matches the specified search parameters. Compared to getMultiReadResultEntry(), this method returns exactly one ReadResultEntry. Compared to getSingleMemoryReadResultEntry(), this method will return a CompletableReadResultEntry regardless of whether the data is cached or not. Th...
[ "Returns", "the", "first", "ReadResultEntry", "that", "matches", "the", "specified", "search", "parameters", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L738-L784
131,917
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.createDataNotAvailableRead
private ReadResultEntryBase createDataNotAvailableRead(long streamSegmentOffset, int maxLength) { maxLength = getLengthUntilNextEntry(streamSegmentOffset, maxLength); long storageLength = this.metadata.getStorageLength(); if (streamSegmentOffset < storageLength) { // Requested data e...
java
private ReadResultEntryBase createDataNotAvailableRead(long streamSegmentOffset, int maxLength) { maxLength = getLengthUntilNextEntry(streamSegmentOffset, maxLength); long storageLength = this.metadata.getStorageLength(); if (streamSegmentOffset < storageLength) { // Requested data e...
[ "private", "ReadResultEntryBase", "createDataNotAvailableRead", "(", "long", "streamSegmentOffset", ",", "int", "maxLength", ")", "{", "maxLength", "=", "getLengthUntilNextEntry", "(", "streamSegmentOffset", ",", "maxLength", ")", ";", "long", "storageLength", "=", "thi...
Creates a ReadResultEntry that is a placeholder for data that is not currently available in memory. @param streamSegmentOffset The Offset in the StreamSegment where to the ReadResultEntry starts at. @param maxLength The maximum length of the Read, from the Offset of this ReadResultEntry.
[ "Creates", "a", "ReadResultEntry", "that", "is", "a", "placeholder", "for", "data", "that", "is", "not", "currently", "available", "in", "memory", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L922-L942
131,918
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.createMemoryRead
@GuardedBy("lock") private CacheReadResultEntry createMemoryRead(ReadIndexEntry entry, long streamSegmentOffset, int maxLength, boolean updateStats) { assert streamSegmentOffset >= entry.getStreamSegmentOffset() : String.format("streamSegmentOffset{%d} < entry.getStreamSegmentOffset{%d}", streamSegmentOffse...
java
@GuardedBy("lock") private CacheReadResultEntry createMemoryRead(ReadIndexEntry entry, long streamSegmentOffset, int maxLength, boolean updateStats) { assert streamSegmentOffset >= entry.getStreamSegmentOffset() : String.format("streamSegmentOffset{%d} < entry.getStreamSegmentOffset{%d}", streamSegmentOffse...
[ "@", "GuardedBy", "(", "\"lock\"", ")", "private", "CacheReadResultEntry", "createMemoryRead", "(", "ReadIndexEntry", "entry", ",", "long", "streamSegmentOffset", ",", "int", "maxLength", ",", "boolean", "updateStats", ")", "{", "assert", "streamSegmentOffset", ">=", ...
Creates a ReadResultEntry for data that is readily available in memory. @param entry The CacheIndexEntry to use. @param streamSegmentOffset The Offset in the StreamSegment where to the ReadResultEntry starts at. @param maxLength The maximum length of the Read, from the Offset of this ReadResult...
[ "Creates", "a", "ReadResultEntry", "for", "data", "that", "is", "readily", "available", "in", "memory", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L952-L970
131,919
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.getLengthUntilNextEntry
@GuardedBy("lock") private int getLengthUntilNextEntry(long startOffset, int maxLength) { ReadIndexEntry ceilingEntry = this.indexEntries.getCeiling(startOffset); if (ceilingEntry != null) { maxLength = (int) Math.min(maxLength, ceilingEntry.getStreamSegmentOffset() - startOffset); ...
java
@GuardedBy("lock") private int getLengthUntilNextEntry(long startOffset, int maxLength) { ReadIndexEntry ceilingEntry = this.indexEntries.getCeiling(startOffset); if (ceilingEntry != null) { maxLength = (int) Math.min(maxLength, ceilingEntry.getStreamSegmentOffset() - startOffset); ...
[ "@", "GuardedBy", "(", "\"lock\"", ")", "private", "int", "getLengthUntilNextEntry", "(", "long", "startOffset", ",", "int", "maxLength", ")", "{", "ReadIndexEntry", "ceilingEntry", "=", "this", ".", "indexEntries", ".", "getCeiling", "(", "startOffset", ")", ";...
Returns the length from the given offset until the beginning of the next index entry. If no such entry exists, or if the length is greater than maxLength, then maxLength is returned. @param startOffset The offset to search from. @param maxLength The maximum allowed length. @return The result.
[ "Returns", "the", "length", "from", "the", "given", "offset", "until", "the", "beginning", "of", "the", "next", "index", "entry", ".", "If", "no", "such", "entry", "exists", "or", "if", "the", "length", "is", "greater", "than", "maxLength", "then", "maxLen...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L1009-L1017
131,920
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.getReadAlignedLength
private int getReadAlignedLength(long offset, int readLength) { // Calculate how many bytes over the last alignment marker the offset is. int lengthSinceLastMultiple = (int) (offset % this.config.getStorageReadAlignment()); // Even though we were asked to read a number of bytes, in some cases w...
java
private int getReadAlignedLength(long offset, int readLength) { // Calculate how many bytes over the last alignment marker the offset is. int lengthSinceLastMultiple = (int) (offset % this.config.getStorageReadAlignment()); // Even though we were asked to read a number of bytes, in some cases w...
[ "private", "int", "getReadAlignedLength", "(", "long", "offset", ",", "int", "readLength", ")", "{", "// Calculate how many bytes over the last alignment marker the offset is.", "int", "lengthSinceLastMultiple", "=", "(", "int", ")", "(", "offset", "%", "this", ".", "co...
Returns an adjusted read length based on the given input, making sure the end of the Read Request is aligned with a multiple of STORAGE_READ_MAX_LEN. @param offset The read offset. @param readLength The requested read length. @return The adjusted (aligned) read length.
[ "Returns", "an", "adjusted", "read", "length", "based", "on", "the", "given", "input", "making", "sure", "the", "end", "of", "the", "Read", "Request", "is", "aligned", "with", "a", "multiple", "of", "STORAGE_READ_MAX_LEN", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L1027-L1034
131,921
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.createFutureRead
private ReadResultEntryBase createFutureRead(long streamSegmentOffset, int maxLength) { FutureReadResultEntry entry = new FutureReadResultEntry(streamSegmentOffset, maxLength); this.futureReads.add(entry); return entry; }
java
private ReadResultEntryBase createFutureRead(long streamSegmentOffset, int maxLength) { FutureReadResultEntry entry = new FutureReadResultEntry(streamSegmentOffset, maxLength); this.futureReads.add(entry); return entry; }
[ "private", "ReadResultEntryBase", "createFutureRead", "(", "long", "streamSegmentOffset", ",", "int", "maxLength", ")", "{", "FutureReadResultEntry", "entry", "=", "new", "FutureReadResultEntry", "(", "streamSegmentOffset", ",", "maxLength", ")", ";", "this", ".", "fu...
Creates a ReadResultEntry that is a placeholder for data that is not in memory, or in storage, which has a starting offset beyond the length of the StreamSegment. @param streamSegmentOffset The Offset in the StreamSegment where to the ReadResultEntry starts at. @param maxLength The maximum length of the Read...
[ "Creates", "a", "ReadResultEntry", "that", "is", "a", "placeholder", "for", "data", "that", "is", "not", "in", "memory", "or", "in", "storage", "which", "has", "a", "starting", "offset", "beyond", "the", "length", "of", "the", "StreamSegment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L1043-L1047
131,922
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java
StreamSegmentReadIndex.getAllEntries
private List<MergedIndexEntry> getAllEntries(long offsetAdjustment) { Exceptions.checkArgument(offsetAdjustment >= 0, "offsetAdjustment", "offsetAdjustment must be a non-negative number."); synchronized (this.lock) { List<MergedIndexEntry> result = new ArrayList<>(this.indexEntries.size());...
java
private List<MergedIndexEntry> getAllEntries(long offsetAdjustment) { Exceptions.checkArgument(offsetAdjustment >= 0, "offsetAdjustment", "offsetAdjustment must be a non-negative number."); synchronized (this.lock) { List<MergedIndexEntry> result = new ArrayList<>(this.indexEntries.size());...
[ "private", "List", "<", "MergedIndexEntry", ">", "getAllEntries", "(", "long", "offsetAdjustment", ")", "{", "Exceptions", ".", "checkArgument", "(", "offsetAdjustment", ">=", "0", ",", "\"offsetAdjustment\"", ",", "\"offsetAdjustment must be a non-negative number.\"", ")...
Gets a copy of all the ReadIndexEntries in this Index that are not RedirectReadIndices. All returned entries have their offsets adjusted by the given amount. @param offsetAdjustment The amount to adjust the offset by.
[ "Gets", "a", "copy", "of", "all", "the", "ReadIndexEntries", "in", "this", "Index", "that", "are", "not", "RedirectReadIndices", ".", "All", "returned", "entries", "have", "their", "offsets", "adjusted", "by", "the", "given", "amount", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L1055-L1068
131,923
pravega/pravega
client/src/main/java/io/pravega/client/stream/impl/ReaderGroupImpl.java
ReaderGroupImpl.waitForCheckpointComplete
private CompletableFuture<Void> waitForCheckpointComplete(String checkpointName, ScheduledExecutorService backgroundExecutor) { AtomicBoolean checkpointPending = new AtomicBoolean(true); return Futures.loop(checkpointPending::get, () -> { ...
java
private CompletableFuture<Void> waitForCheckpointComplete(String checkpointName, ScheduledExecutorService backgroundExecutor) { AtomicBoolean checkpointPending = new AtomicBoolean(true); return Futures.loop(checkpointPending::get, () -> { ...
[ "private", "CompletableFuture", "<", "Void", ">", "waitForCheckpointComplete", "(", "String", "checkpointName", ",", "ScheduledExecutorService", "backgroundExecutor", ")", "{", "AtomicBoolean", "checkpointPending", "=", "new", "AtomicBoolean", "(", "true", ")", ";", "re...
Periodically check the state synchronizer if the given Checkpoint is complete. @param checkpointName Checkpoint name. @param backgroundExecutor Executor on which the asynchronous task will run. @return A CompletableFuture will be complete once the Checkpoint is complete.
[ "Periodically", "check", "the", "state", "synchronizer", "if", "the", "given", "Checkpoint", "is", "complete", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/ReaderGroupImpl.java#L147-L161
131,924
pravega/pravega
client/src/main/java/io/pravega/client/stream/impl/ReaderGroupImpl.java
ReaderGroupImpl.resetReadersToCheckpoint
@Override @Deprecated public void resetReadersToCheckpoint(Checkpoint checkpoint) { synchronizer.updateState((state, updates) -> { ReaderGroupConfig config = state.getConfig(); Map<Segment, Long> positions = new HashMap<>(); for (StreamCut cut : checkpoint.asImpl().ge...
java
@Override @Deprecated public void resetReadersToCheckpoint(Checkpoint checkpoint) { synchronizer.updateState((state, updates) -> { ReaderGroupConfig config = state.getConfig(); Map<Segment, Long> positions = new HashMap<>(); for (StreamCut cut : checkpoint.asImpl().ge...
[ "@", "Override", "@", "Deprecated", "public", "void", "resetReadersToCheckpoint", "(", "Checkpoint", "checkpoint", ")", "{", "synchronizer", ".", "updateState", "(", "(", "state", ",", "updates", ")", "->", "{", "ReaderGroupConfig", "config", "=", "state", ".", ...
Used to reset a reset a reader group to a checkpoint. This should be removed in time. @deprecated Use {@link ReaderGroup#resetReaderGroup(ReaderGroupConfig)} to reset readers to a given Checkpoint.
[ "Used", "to", "reset", "a", "reset", "a", "reader", "group", "to", "a", "checkpoint", ".", "This", "should", "be", "removed", "in", "time", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/ReaderGroupImpl.java#L178-L189
131,925
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/ZKStoreHelper.java
ZKStoreHelper.deletePath
CompletableFuture<Void> deletePath(final String path, final boolean deleteEmptyContainer) { final CompletableFuture<Void> result = new CompletableFuture<>(); final CompletableFuture<Void> deleteNode = new CompletableFuture<>(); try { client.delete().inBackground( ...
java
CompletableFuture<Void> deletePath(final String path, final boolean deleteEmptyContainer) { final CompletableFuture<Void> result = new CompletableFuture<>(); final CompletableFuture<Void> deleteNode = new CompletableFuture<>(); try { client.delete().inBackground( ...
[ "CompletableFuture", "<", "Void", ">", "deletePath", "(", "final", "String", "path", ",", "final", "boolean", "deleteEmptyContainer", ")", "{", "final", "CompletableFuture", "<", "Void", ">", "result", "=", "new", "CompletableFuture", "<>", "(", ")", ";", "fin...
region curator client store access
[ "region", "curator", "client", "store", "access" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/ZKStoreHelper.java#L89-L132
131,926
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/ZKStoreHelper.java
ZKStoreHelper.getData
public <T> CompletableFuture<VersionedMetadata<T>> getData(final String path, Function<byte[], T> fromBytes) { final CompletableFuture<VersionedMetadata<T>> result = new CompletableFuture<>(); try { client.getData().inBackground( callback(event -> { ...
java
public <T> CompletableFuture<VersionedMetadata<T>> getData(final String path, Function<byte[], T> fromBytes) { final CompletableFuture<VersionedMetadata<T>> result = new CompletableFuture<>(); try { client.getData().inBackground( callback(event -> { ...
[ "public", "<", "T", ">", "CompletableFuture", "<", "VersionedMetadata", "<", "T", ">", ">", "getData", "(", "final", "String", "path", ",", "Function", "<", "byte", "[", "]", ",", "T", ">", "fromBytes", ")", "{", "final", "CompletableFuture", "<", "Versi...
Method to retrieve an entity from zookeeper and then deserialize it using the supplied `fromBytes` function. @param path Zk path where entity is stored @param fromBytes Deserialization function for creating object of type T @param <T> Type of Object to retrieve. @return CompletableFuture which when completed will have ...
[ "Method", "to", "retrieve", "an", "entity", "from", "zookeeper", "and", "then", "deserialize", "it", "using", "the", "supplied", "fromBytes", "function", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/ZKStoreHelper.java#L156-L177
131,927
pravega/pravega
common/src/main/java/io/pravega/common/util/ToStringUtils.java
ToStringUtils.compressToBase64
@SneakyThrows(IOException.class) public static String compressToBase64(final String string) { Preconditions.checkNotNull(string, "string"); @Cleanup final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); @Cleanup final OutputStream base64OutputStream...
java
@SneakyThrows(IOException.class) public static String compressToBase64(final String string) { Preconditions.checkNotNull(string, "string"); @Cleanup final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); @Cleanup final OutputStream base64OutputStream...
[ "@", "SneakyThrows", "(", "IOException", ".", "class", ")", "public", "static", "String", "compressToBase64", "(", "final", "String", "string", ")", "{", "Preconditions", ".", "checkNotNull", "(", "string", ",", "\"string\"", ")", ";", "@", "Cleanup", "final",...
Convert the given string to its compressed base64 representation. @param string String to be compressed to base64. @return String Compressed Base64 representation of the input string. @throws NullPointerException If string is null.
[ "Convert", "the", "given", "string", "to", "its", "compressed", "base64", "representation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ToStringUtils.java#L125-L137
131,928
pravega/pravega
common/src/main/java/io/pravega/common/util/ToStringUtils.java
ToStringUtils.decompressFromBase64
@SneakyThrows(IOException.class) public static String decompressFromBase64(final String base64CompressedString) { Exceptions.checkNotNullOrEmpty(base64CompressedString, "base64CompressedString"); try { @Cleanup final ByteArrayInputStream byteArrayInputStream = new ByteArrayIn...
java
@SneakyThrows(IOException.class) public static String decompressFromBase64(final String base64CompressedString) { Exceptions.checkNotNullOrEmpty(base64CompressedString, "base64CompressedString"); try { @Cleanup final ByteArrayInputStream byteArrayInputStream = new ByteArrayIn...
[ "@", "SneakyThrows", "(", "IOException", ".", "class", ")", "public", "static", "String", "decompressFromBase64", "(", "final", "String", "base64CompressedString", ")", "{", "Exceptions", ".", "checkNotNullOrEmpty", "(", "base64CompressedString", ",", "\"base64Compresse...
Get the original string from its compressed base64 representation. @param base64CompressedString Compressed Base64 representation of the string. @return The original string. @throws NullPointerException If base64CompressedString is null. @throws IllegalArgumentException If base64CompressedString is not null, but has a ...
[ "Get", "the", "original", "string", "from", "its", "compressed", "base64", "representation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ToStringUtils.java#L146-L160
131,929
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/records/StreamTruncationRecord.java
StreamTruncationRecord.complete
public static StreamTruncationRecord complete(StreamTruncationRecord toComplete) { Preconditions.checkState(toComplete.updating); ImmutableSet.Builder<Long> builder = ImmutableSet.builder(); builder.addAll(toComplete.deletedSegments); builder.addAll(toComplete.toDelete); ...
java
public static StreamTruncationRecord complete(StreamTruncationRecord toComplete) { Preconditions.checkState(toComplete.updating); ImmutableSet.Builder<Long> builder = ImmutableSet.builder(); builder.addAll(toComplete.deletedSegments); builder.addAll(toComplete.toDelete); ...
[ "public", "static", "StreamTruncationRecord", "complete", "(", "StreamTruncationRecord", "toComplete", ")", "{", "Preconditions", ".", "checkState", "(", "toComplete", ".", "updating", ")", ";", "ImmutableSet", ".", "Builder", "<", "Long", ">", "builder", "=", "Im...
Method to complete a given ongoing truncation record by setting updating flag to false and merging toDelete in deletedSegments. @param toComplete record to complete @return new record that has the updating flag set to false
[ "Method", "to", "complete", "a", "given", "ongoing", "truncation", "record", "by", "setting", "updating", "flag", "to", "false", "and", "merging", "toDelete", "in", "deletedSegments", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/StreamTruncationRecord.java#L100-L115
131,930
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/WriterState.java
WriterState.recordIterationStarted
void recordIterationStarted(AbstractTimer timer) { this.iterationId.incrementAndGet(); this.currentIterationStartTime.set(timer.getElapsed()); this.lastIterationError.set(false); }
java
void recordIterationStarted(AbstractTimer timer) { this.iterationId.incrementAndGet(); this.currentIterationStartTime.set(timer.getElapsed()); this.lastIterationError.set(false); }
[ "void", "recordIterationStarted", "(", "AbstractTimer", "timer", ")", "{", "this", ".", "iterationId", ".", "incrementAndGet", "(", ")", ";", "this", ".", "currentIterationStartTime", ".", "set", "(", "timer", ".", "getElapsed", "(", ")", ")", ";", "this", "...
Records the fact that an iteration started. @param timer The reference timer.
[ "Records", "the", "fact", "that", "an", "iteration", "started", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/WriterState.java#L57-L61
131,931
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/WriterState.java
WriterState.setLastTruncatedSequenceNumber
void setLastTruncatedSequenceNumber(long value) { Preconditions.checkArgument(value >= this.lastTruncatedSequenceNumber.get(), "New LastTruncatedSequenceNumber cannot be smaller than the previous one."); this.lastTruncatedSequenceNumber.set(value); }
java
void setLastTruncatedSequenceNumber(long value) { Preconditions.checkArgument(value >= this.lastTruncatedSequenceNumber.get(), "New LastTruncatedSequenceNumber cannot be smaller than the previous one."); this.lastTruncatedSequenceNumber.set(value); }
[ "void", "setLastTruncatedSequenceNumber", "(", "long", "value", ")", "{", "Preconditions", ".", "checkArgument", "(", "value", ">=", "this", ".", "lastTruncatedSequenceNumber", ".", "get", "(", ")", ",", "\"New LastTruncatedSequenceNumber cannot be smaller than the previous...
Sets the Sequence Number of the last Truncated Operation. @param value The Sequence Number to set.
[ "Sets", "the", "Sequence", "Number", "of", "the", "last", "Truncated", "Operation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/WriterState.java#L105-L108
131,932
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/WriterState.java
WriterState.setLastReadSequenceNumber
void setLastReadSequenceNumber(long value) { Preconditions.checkArgument(value >= this.lastReadSequenceNumber.get(), "New LastReadSequenceNumber cannot be smaller than the previous one."); this.lastReadSequenceNumber.set(value); }
java
void setLastReadSequenceNumber(long value) { Preconditions.checkArgument(value >= this.lastReadSequenceNumber.get(), "New LastReadSequenceNumber cannot be smaller than the previous one."); this.lastReadSequenceNumber.set(value); }
[ "void", "setLastReadSequenceNumber", "(", "long", "value", ")", "{", "Preconditions", ".", "checkArgument", "(", "value", ">=", "this", ".", "lastReadSequenceNumber", ".", "get", "(", ")", ",", "\"New LastReadSequenceNumber cannot be smaller than the previous one.\"", ")"...
Sets the Sequence Number of the last read Operation. @param value The Sequence Number to set.
[ "Sets", "the", "Sequence", "Number", "of", "the", "last", "read", "Operation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/WriterState.java#L122-L125
131,933
pravega/pravega
common/src/main/java/io/pravega/common/lang/ProcessStarter.java
ProcessStarter.sysProp
public ProcessStarter sysProp(String name, Object value) { this.systemProps.put(name, value.toString()); return this; }
java
public ProcessStarter sysProp(String name, Object value) { this.systemProps.put(name, value.toString()); return this; }
[ "public", "ProcessStarter", "sysProp", "(", "String", "name", ",", "Object", "value", ")", "{", "this", ".", "systemProps", ".", "put", "(", "name", ",", "value", ".", "toString", "(", ")", ")", ";", "return", "this", ";", "}" ]
Includes the given System Property as part of the start. @param name The System Property Name. @param value The System Property Value. This will have toString() invoked on it. @return This object instance.
[ "Includes", "the", "given", "System", "Property", "as", "part", "of", "the", "start", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/lang/ProcessStarter.java#L70-L73
131,934
pravega/pravega
common/src/main/java/io/pravega/common/lang/ProcessStarter.java
ProcessStarter.env
public ProcessStarter env(String name, Object value) { this.builder.environment().put(name, value.toString()); return this; }
java
public ProcessStarter env(String name, Object value) { this.builder.environment().put(name, value.toString()); return this; }
[ "public", "ProcessStarter", "env", "(", "String", "name", ",", "Object", "value", ")", "{", "this", ".", "builder", ".", "environment", "(", ")", ".", "put", "(", "name", ",", "value", ".", "toString", "(", ")", ")", ";", "return", "this", ";", "}" ]
Includes the given Environment Variable as part of the start. @param name The Environment Variable Name. @param value The Environment Variable Value. This will have toString() invoked on it. @return This object instance.
[ "Includes", "the", "given", "Environment", "Variable", "as", "part", "of", "the", "start", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/lang/ProcessStarter.java#L82-L85
131,935
pravega/pravega
common/src/main/java/io/pravega/common/lang/ProcessStarter.java
ProcessStarter.start
public Process start() throws IOException { ArrayList<String> cmd = new ArrayList<>(); // Invoke Java and setup classpath. cmd.add(System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"); cmd.add("-cp"); cmd.add(System.getProperty("java.class.path"));...
java
public Process start() throws IOException { ArrayList<String> cmd = new ArrayList<>(); // Invoke Java and setup classpath. cmd.add(System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"); cmd.add("-cp"); cmd.add(System.getProperty("java.class.path"));...
[ "public", "Process", "start", "(", ")", "throws", "IOException", "{", "ArrayList", "<", "String", ">", "cmd", "=", "new", "ArrayList", "<>", "(", ")", ";", "// Invoke Java and setup classpath.", "cmd", ".", "add", "(", "System", ".", "getProperty", "(", "\"j...
Executes the Class using the accumulated options. @return The Process reference. @throws IOException If an error occurred.
[ "Executes", "the", "Class", "using", "the", "accumulated", "options", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/lang/ProcessStarter.java#L137-L159
131,936
pravega/pravega
controller/src/main/java/io/pravega/controller/server/ControllerService.java
ControllerService.createScope
public CompletableFuture<CreateScopeStatus> createScope(final String scope) { Exceptions.checkNotNullOrEmpty(scope, "scope"); try { NameUtils.validateScopeName(scope); } catch (IllegalArgumentException | NullPointerException e) { log.warn("Create scope failed due to inval...
java
public CompletableFuture<CreateScopeStatus> createScope(final String scope) { Exceptions.checkNotNullOrEmpty(scope, "scope"); try { NameUtils.validateScopeName(scope); } catch (IllegalArgumentException | NullPointerException e) { log.warn("Create scope failed due to inval...
[ "public", "CompletableFuture", "<", "CreateScopeStatus", ">", "createScope", "(", "final", "String", "scope", ")", "{", "Exceptions", ".", "checkNotNullOrEmpty", "(", "scope", ",", "\"scope\"", ")", ";", "try", "{", "NameUtils", ".", "validateScopeName", "(", "s...
Controller Service API to create scope. @param scope Name of scope to be created. @return Status of create scope.
[ "Controller", "Service", "API", "to", "create", "scope", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/ControllerService.java#L402-L412
131,937
pravega/pravega
controller/src/main/java/io/pravega/controller/server/ControllerService.java
ControllerService.deleteScope
public CompletableFuture<DeleteScopeStatus> deleteScope(final String scope) { Exceptions.checkNotNullOrEmpty(scope, "scope"); return streamStore.deleteScope(scope); }
java
public CompletableFuture<DeleteScopeStatus> deleteScope(final String scope) { Exceptions.checkNotNullOrEmpty(scope, "scope"); return streamStore.deleteScope(scope); }
[ "public", "CompletableFuture", "<", "DeleteScopeStatus", ">", "deleteScope", "(", "final", "String", "scope", ")", "{", "Exceptions", ".", "checkNotNullOrEmpty", "(", "scope", ",", "\"scope\"", ")", ";", "return", "streamStore", ".", "deleteScope", "(", "scope", ...
Controller Service API to delete scope. @param scope Name of scope to be deleted. @return Status of delete scope.
[ "Controller", "Service", "API", "to", "delete", "scope", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/ControllerService.java#L420-L423
131,938
pravega/pravega
controller/src/main/java/io/pravega/controller/server/ControllerService.java
ControllerService.getScope
public CompletableFuture<String> getScope(final String scopeName) { Preconditions.checkNotNull(scopeName); return streamStore.getScopeConfiguration(scopeName); }
java
public CompletableFuture<String> getScope(final String scopeName) { Preconditions.checkNotNull(scopeName); return streamStore.getScopeConfiguration(scopeName); }
[ "public", "CompletableFuture", "<", "String", ">", "getScope", "(", "final", "String", "scopeName", ")", "{", "Preconditions", ".", "checkNotNull", "(", "scopeName", ")", ";", "return", "streamStore", ".", "getScopeConfiguration", "(", "scopeName", ")", ";", "}"...
Retrieve a scope. @param scopeName Name of Scope. @return Scope if it exists.
[ "Retrieve", "a", "scope", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/ControllerService.java#L464-L467
131,939
pravega/pravega
controller/src/main/java/io/pravega/controller/server/ControllerService.java
ControllerService.reportCreateStreamMetrics
private void reportCreateStreamMetrics(String scope, String streamName, int initialSegments, CreateStreamStatus.Status status, Duration latency) { if (status.equals(CreateStreamStatus.Status.SUCCESS)) { streamMetrics.createStream(scope, streamName, initialS...
java
private void reportCreateStreamMetrics(String scope, String streamName, int initialSegments, CreateStreamStatus.Status status, Duration latency) { if (status.equals(CreateStreamStatus.Status.SUCCESS)) { streamMetrics.createStream(scope, streamName, initialS...
[ "private", "void", "reportCreateStreamMetrics", "(", "String", "scope", ",", "String", "streamName", ",", "int", "initialSegments", ",", "CreateStreamStatus", ".", "Status", "status", ",", "Duration", "latency", ")", "{", "if", "(", "status", ".", "equals", "(",...
Metrics reporting region
[ "Metrics", "reporting", "region" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/ControllerService.java#L471-L478
131,940
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java
WriterTableProcessor.compactIfNeeded
private CompletableFuture<Void> compactIfNeeded(DirectSegmentAccess segment, long highestCopiedOffset, TimeoutTimer timer) { // Decide if compaction is needed. If not, bail out early. SegmentProperties info = segment.getInfo(); CompletableFuture<Void> result; if (this.compactor.isCompac...
java
private CompletableFuture<Void> compactIfNeeded(DirectSegmentAccess segment, long highestCopiedOffset, TimeoutTimer timer) { // Decide if compaction is needed. If not, bail out early. SegmentProperties info = segment.getInfo(); CompletableFuture<Void> result; if (this.compactor.isCompac...
[ "private", "CompletableFuture", "<", "Void", ">", "compactIfNeeded", "(", "DirectSegmentAccess", "segment", ",", "long", "highestCopiedOffset", ",", "TimeoutTimer", "timer", ")", "{", "// Decide if compaction is needed. If not, bail out early.", "SegmentProperties", "info", "...
Performs a Table Segment Compaction if needed. @param segment The Segment to compact. @param highestCopiedOffset The highest copied offset that was encountered during indexing. This is used to determine where to safely truncate the segment, if at all. @param timer Timer for the operation. @re...
[ "Performs", "a", "Table", "Segment", "Compaction", "if", "needed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java#L200-L232
131,941
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java
WriterTableProcessor.flushOnce
private CompletableFuture<TableWriterFlushResult> flushOnce(DirectSegmentAccess segment, TimeoutTimer timer) { // Index all the keys in the segment range pointed to by the aggregator. KeyUpdateCollection keyUpdates = readKeysFromSegment(segment, this.aggregator.getFirstOffset(), this.aggregator.getLastO...
java
private CompletableFuture<TableWriterFlushResult> flushOnce(DirectSegmentAccess segment, TimeoutTimer timer) { // Index all the keys in the segment range pointed to by the aggregator. KeyUpdateCollection keyUpdates = readKeysFromSegment(segment, this.aggregator.getFirstOffset(), this.aggregator.getLastO...
[ "private", "CompletableFuture", "<", "TableWriterFlushResult", ">", "flushOnce", "(", "DirectSegmentAccess", "segment", ",", "TimeoutTimer", "timer", ")", "{", "// Index all the keys in the segment range pointed to by the aggregator.", "KeyUpdateCollection", "keyUpdates", "=", "r...
Performs a single flush attempt. @param segment A {@link DirectSegmentAccess} representing the Segment to flush on. @param timer Timer for the operation. @return A CompletableFuture that, when completed, will indicate the flush has completed successfully. If the operation failed, it will be failed with the appropria...
[ "Performs", "a", "single", "flush", "attempt", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java#L285-L304
131,942
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java
WriterTableProcessor.readKeysFromSegment
@SneakyThrows(IOException.class) private KeyUpdateCollection readKeysFromSegment(DirectSegmentAccess segment, long firstOffset, long lastOffset, TimeoutTimer timer) { KeyUpdateCollection keyUpdates = new KeyUpdateCollection(); try (InputStream input = readFromInMemorySegment(segment, firstOffset, la...
java
@SneakyThrows(IOException.class) private KeyUpdateCollection readKeysFromSegment(DirectSegmentAccess segment, long firstOffset, long lastOffset, TimeoutTimer timer) { KeyUpdateCollection keyUpdates = new KeyUpdateCollection(); try (InputStream input = readFromInMemorySegment(segment, firstOffset, la...
[ "@", "SneakyThrows", "(", "IOException", ".", "class", ")", "private", "KeyUpdateCollection", "readKeysFromSegment", "(", "DirectSegmentAccess", "segment", ",", "long", "firstOffset", ",", "long", "lastOffset", ",", "TimeoutTimer", "timer", ")", "{", "KeyUpdateCollect...
Reads all the Keys from the given Segment between the given offsets and indexes them by key. @param segment The InputStream to process. @param firstOffset The first offset in the Segment to start reading Keys at. @param lastOffset The last offset in the Segment to read Keys until. @param timer Timer for the...
[ "Reads", "all", "the", "Keys", "from", "the", "given", "Segment", "between", "the", "given", "offsets", "and", "indexes", "them", "by", "key", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java#L343-L353
131,943
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java
WriterTableProcessor.indexSingleKey
private int indexSingleKey(InputStream input, long entryOffset, KeyUpdateCollection keyUpdateCollection) throws IOException { // Retrieve the next entry, get its Key and hash it. val e = AsyncTableEntryReader.readEntryComponents(input, entryOffset, this.connector.getSerializer()); HashedArray ke...
java
private int indexSingleKey(InputStream input, long entryOffset, KeyUpdateCollection keyUpdateCollection) throws IOException { // Retrieve the next entry, get its Key and hash it. val e = AsyncTableEntryReader.readEntryComponents(input, entryOffset, this.connector.getSerializer()); HashedArray ke...
[ "private", "int", "indexSingleKey", "(", "InputStream", "input", ",", "long", "entryOffset", ",", "KeyUpdateCollection", "keyUpdateCollection", ")", "throws", "IOException", "{", "// Retrieve the next entry, get its Key and hash it.", "val", "e", "=", "AsyncTableEntryReader",...
Indexes a single Key for a Table Entry that begins with the first byte of the given InputStream. @param input The InputStream that contains the Table Entry to index. @param entryOffset The offset within the Segment where this Table Entry begins. @param keyUpdateCollection A Map where to add the result. @retu...
[ "Indexes", "a", "single", "Key", "for", "a", "Table", "Entry", "that", "begins", "with", "the", "first", "byte", "of", "the", "given", "InputStream", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java#L364-L373
131,944
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java
WriterTableProcessor.readFromInMemorySegment
private InputStream readFromInMemorySegment(DirectSegmentAccess segment, long startOffset, long endOffset, TimeoutTimer timer) { long readOffset = startOffset; long remainingLength = endOffset - startOffset; ArrayList<InputStream> inputs = new ArrayList<>(); while (remainingLength > 0) {...
java
private InputStream readFromInMemorySegment(DirectSegmentAccess segment, long startOffset, long endOffset, TimeoutTimer timer) { long readOffset = startOffset; long remainingLength = endOffset - startOffset; ArrayList<InputStream> inputs = new ArrayList<>(); while (remainingLength > 0) {...
[ "private", "InputStream", "readFromInMemorySegment", "(", "DirectSegmentAccess", "segment", ",", "long", "startOffset", ",", "long", "endOffset", ",", "TimeoutTimer", "timer", ")", "{", "long", "readOffset", "=", "startOffset", ";", "long", "remainingLength", "=", "...
Reads from the Segment between the given offsets. This method assumes all the data is readily available in the cache, otherwise it will block synchronously for Storage retrieval. @param segment The Segment to read from. @param startOffset The offset to start reading from. @param endOffset The offset to stop read...
[ "Reads", "from", "the", "Segment", "between", "the", "given", "offsets", ".", "This", "method", "assumes", "all", "the", "data", "is", "readily", "available", "in", "the", "cache", "otherwise", "it", "will", "block", "synchronously", "for", "Storage", "retriev...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/WriterTableProcessor.java#L385-L400
131,945
pravega/pravega
client/src/main/java/io/pravega/client/stream/impl/CheckpointState.java
CheckpointState.getOutstandingCheckpoints
int getOutstandingCheckpoints() { return (int) checkpoints.stream() .filter(checkpoint -> !(isCheckpointSilent(checkpoint) || isCheckpointComplete(checkpoint))) .count(); }
java
int getOutstandingCheckpoints() { return (int) checkpoints.stream() .filter(checkpoint -> !(isCheckpointSilent(checkpoint) || isCheckpointComplete(checkpoint))) .count(); }
[ "int", "getOutstandingCheckpoints", "(", ")", "{", "return", "(", "int", ")", "checkpoints", ".", "stream", "(", ")", ".", "filter", "(", "checkpoint", "->", "!", "(", "isCheckpointSilent", "(", "checkpoint", ")", "||", "isCheckpointComplete", "(", "checkpoint...
Get the number of outstanding Checkpoints. It should not take silent Checkpoints into account. @return the number of outstanding Checkpoints.
[ "Get", "the", "number", "of", "outstanding", "Checkpoints", ".", "It", "should", "not", "take", "silent", "Checkpoints", "into", "account", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/CheckpointState.java#L154-L158
131,946
pravega/pravega
shared/metrics/src/main/java/io/pravega/shared/metrics/StatsLoggerProxy.java
StatsLoggerProxy.getOrSet
private <T extends Metric, V extends MetricProxy<T>> V getOrSet(ConcurrentHashMap<String, V> cache, String name, Function<String, T> createMetric, ProxyCreator<T, V> createProxy, Strin...
java
private <T extends Metric, V extends MetricProxy<T>> V getOrSet(ConcurrentHashMap<String, V> cache, String name, Function<String, T> createMetric, ProxyCreator<T, V> createProxy, Strin...
[ "private", "<", "T", "extends", "Metric", ",", "V", "extends", "MetricProxy", "<", "T", ">", ">", "V", "getOrSet", "(", "ConcurrentHashMap", "<", "String", ",", "V", ">", "cache", ",", "String", "name", ",", "Function", "<", "String", ",", "T", ">", ...
Atomically gets an existing MetricProxy from the given cache or creates a new one and adds it. @param cache The Cache to get or insert into. @param name Metric/Proxy name. @param createMetric A Function that creates a new Metric given its name. @param createProxy A Function that creates a MetricProxy g...
[ "Atomically", "gets", "an", "existing", "MetricProxy", "from", "the", "given", "cache", "or", "creates", "a", "new", "one", "and", "adds", "it", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/metrics/src/main/java/io/pravega/shared/metrics/StatsLoggerProxy.java#L86-L105
131,947
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java
BookKeeperServiceRunner.stopBookie
public void stopBookie(int bookieIndex) { Preconditions.checkState(this.servers.size() > 0, "No Bookies initialized. Call startAll()."); Preconditions.checkState(this.servers.get(0) != null, "Bookie already stopped."); val bk = this.servers.get(bookieIndex); bk.shutdown(); this.s...
java
public void stopBookie(int bookieIndex) { Preconditions.checkState(this.servers.size() > 0, "No Bookies initialized. Call startAll()."); Preconditions.checkState(this.servers.get(0) != null, "Bookie already stopped."); val bk = this.servers.get(bookieIndex); bk.shutdown(); this.s...
[ "public", "void", "stopBookie", "(", "int", "bookieIndex", ")", "{", "Preconditions", ".", "checkState", "(", "this", ".", "servers", ".", "size", "(", ")", ">", "0", ",", "\"No Bookies initialized. Call startAll().\"", ")", ";", "Preconditions", ".", "checkStat...
Stops the BookieService with the given index. @param bookieIndex The index of the bookie to stop.
[ "Stops", "the", "BookieService", "with", "the", "given", "index", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java#L103-L110
131,948
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java
BookKeeperServiceRunner.startBookie
public void startBookie(int bookieIndex) throws Exception { Preconditions.checkState(this.servers.size() > 0, "No Bookies initialized. Call startAll()."); Preconditions.checkState(this.servers.get(0) == null, "Bookie already running."); this.servers.set(bookieIndex, runBookie(this.bookiePorts.ge...
java
public void startBookie(int bookieIndex) throws Exception { Preconditions.checkState(this.servers.size() > 0, "No Bookies initialized. Call startAll()."); Preconditions.checkState(this.servers.get(0) == null, "Bookie already running."); this.servers.set(bookieIndex, runBookie(this.bookiePorts.ge...
[ "public", "void", "startBookie", "(", "int", "bookieIndex", ")", "throws", "Exception", "{", "Preconditions", ".", "checkState", "(", "this", ".", "servers", ".", "size", "(", ")", ">", "0", ",", "\"No Bookies initialized. Call startAll().\"", ")", ";", "Precond...
Restarts the BookieService with the given index. @param bookieIndex The index of the bookie to restart. @throws Exception If an exception occurred.
[ "Restarts", "the", "BookieService", "with", "the", "given", "index", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java#L118-L123
131,949
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java
BookKeeperServiceRunner.startAll
public void startAll() throws Exception { // Make sure the child processes and any created files get killed/deleted if the process is terminated. this.cleanup.set(new Thread(this::cleanupOnShutdown)); Runtime.getRuntime().addShutdownHook(this.cleanup.get()); if (this.startZk) { ...
java
public void startAll() throws Exception { // Make sure the child processes and any created files get killed/deleted if the process is terminated. this.cleanup.set(new Thread(this::cleanupOnShutdown)); Runtime.getRuntime().addShutdownHook(this.cleanup.get()); if (this.startZk) { ...
[ "public", "void", "startAll", "(", ")", "throws", "Exception", "{", "// Make sure the child processes and any created files get killed/deleted if the process is terminated.", "this", ".", "cleanup", ".", "set", "(", "new", "Thread", "(", "this", "::", "cleanupOnShutdown", "...
Starts the BookKeeper cluster in-process. @throws Exception If an exception occurred.
[ "Starts", "the", "BookKeeper", "cluster", "in", "-", "process", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java#L163-L174
131,950
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java
BookKeeperServiceRunner.main
public static void main(String[] args) throws Exception { val b = BookKeeperServiceRunner.builder(); b.startZk(false); try { int bkBasePort = Integer.parseInt(System.getProperty(PROPERTY_BASE_PORT)); int bkCount = Integer.parseInt(System.getProperty(PROPERTY_BOOKIE_COUNT)...
java
public static void main(String[] args) throws Exception { val b = BookKeeperServiceRunner.builder(); b.startZk(false); try { int bkBasePort = Integer.parseInt(System.getProperty(PROPERTY_BASE_PORT)); int bkCount = Integer.parseInt(System.getProperty(PROPERTY_BOOKIE_COUNT)...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "val", "b", "=", "BookKeeperServiceRunner", ".", "builder", "(", ")", ";", "b", ".", "startZk", "(", "false", ")", ";", "try", "{", "int", "bkBasePort...
Main method that can be used to start BookKeeper out-of-process using BookKeeperServiceRunner. This is used when invoking this class via ProcessStarter. @param args Args. @throws Exception If an error occurred.
[ "Main", "method", "that", "can", "be", "used", "to", "start", "BookKeeper", "out", "-", "of", "-", "process", "using", "BookKeeperServiceRunner", ".", "This", "is", "used", "when", "invoking", "this", "class", "via", "ProcessStarter", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperServiceRunner.java#L264-L294
131,951
pravega/pravega
common/src/main/java/io/pravega/common/util/CircularBuffer.java
CircularBuffer.read
public int read(ByteBuffer toFill) { int originalPos = toFill.position(); while (dataAvailable() > 0 && toFill.hasRemaining()) { readHelper(toFill); } return toFill.position() - originalPos; }
java
public int read(ByteBuffer toFill) { int originalPos = toFill.position(); while (dataAvailable() > 0 && toFill.hasRemaining()) { readHelper(toFill); } return toFill.position() - originalPos; }
[ "public", "int", "read", "(", "ByteBuffer", "toFill", ")", "{", "int", "originalPos", "=", "toFill", ".", "position", "(", ")", ";", "while", "(", "dataAvailable", "(", ")", ">", "0", "&&", "toFill", ".", "hasRemaining", "(", ")", ")", "{", "readHelper...
Copies into the given ByteBuffer. @param toFill The ByteBuffer to fill into. @return the number of bytes put into toFill
[ "Copies", "into", "the", "given", "ByteBuffer", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/CircularBuffer.java#L50-L56
131,952
pravega/pravega
common/src/main/java/io/pravega/common/util/CircularBuffer.java
CircularBuffer.fill
public int fill(ByteBuffer fillFrom) { int origionalPos = fillFrom.position(); while (capacityAvailable() > 0 && fillFrom.hasRemaining()) { fillHelper(fillFrom); } return fillFrom.position() - origionalPos; }
java
public int fill(ByteBuffer fillFrom) { int origionalPos = fillFrom.position(); while (capacityAvailable() > 0 && fillFrom.hasRemaining()) { fillHelper(fillFrom); } return fillFrom.position() - origionalPos; }
[ "public", "int", "fill", "(", "ByteBuffer", "fillFrom", ")", "{", "int", "origionalPos", "=", "fillFrom", ".", "position", "(", ")", ";", "while", "(", "capacityAvailable", "(", ")", ">", "0", "&&", "fillFrom", ".", "hasRemaining", "(", ")", ")", "{", ...
Copies from the given ByteBuffer. @param fillFrom The ByteBuffer to read from. @return the number of bytes read from fillFrom
[ "Copies", "from", "the", "given", "ByteBuffer", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/CircularBuffer.java#L80-L86
131,953
pravega/pravega
common/src/main/java/io/pravega/common/util/CircularBuffer.java
CircularBuffer.dataAvailable
public int dataAvailable() { if (readBuffer.position() < fillBuffer.position()) { return readBuffer.remaining(); } else if (readBuffer.position() > fillBuffer.position()) { return capacity - fillBuffer.remaining(); } else { if (readBuffer.hasRemaining()) { ...
java
public int dataAvailable() { if (readBuffer.position() < fillBuffer.position()) { return readBuffer.remaining(); } else if (readBuffer.position() > fillBuffer.position()) { return capacity - fillBuffer.remaining(); } else { if (readBuffer.hasRemaining()) { ...
[ "public", "int", "dataAvailable", "(", ")", "{", "if", "(", "readBuffer", ".", "position", "(", ")", "<", "fillBuffer", ".", "position", "(", ")", ")", "{", "return", "readBuffer", ".", "remaining", "(", ")", ";", "}", "else", "if", "(", "readBuffer", ...
Gets the number of bytes that can be read. @return Integer indicating the number of bytes that can be read.
[ "Gets", "the", "number", "of", "bytes", "that", "can", "be", "read", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/CircularBuffer.java#L114-L126
131,954
pravega/pravega
controller/src/main/java/io/pravega/controller/task/TaskSweeper.java
TaskSweeper.execute
@SuppressWarnings("unchecked") private CompletableFuture<Object> execute(final String oldHostId, final TaskData taskData, final TaggedResource taggedResource) { log.debug("Host={} attempting to execute task {}-{} for child <{}, {}> of {}", this.hostId, taskData.getMethodName(), taskData.get...
java
@SuppressWarnings("unchecked") private CompletableFuture<Object> execute(final String oldHostId, final TaskData taskData, final TaggedResource taggedResource) { log.debug("Host={} attempting to execute task {}-{} for child <{}, {}> of {}", this.hostId, taskData.getMethodName(), taskData.get...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "CompletableFuture", "<", "Object", ">", "execute", "(", "final", "String", "oldHostId", ",", "final", "TaskData", "taskData", ",", "final", "TaggedResource", "taggedResource", ")", "{", "log", ".", ...
This method identifies correct method to execute form among the task classes and executes it. @param oldHostId identifier of old failed host. @param taskData taks data. @param taggedResource resource on which old host had unfinished task. @return the object returned from task method.
[ "This", "method", "identifies", "correct", "method", "to", "execute", "form", "among", "the", "task", "classes", "and", "executes", "it", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/TaskSweeper.java#L195-L244
131,955
pravega/pravega
controller/src/main/java/io/pravega/controller/task/TaskSweeper.java
TaskSweeper.initializeMappingTable
private void initializeMappingTable() { for (TaskBase taskClassObject : taskClassObjects) { Class<? extends TaskBase> claz = taskClassObject.getClass(); for (Method method : claz.getDeclaredMethods()) { for (Annotation annotation : method.getAnnotations()) { ...
java
private void initializeMappingTable() { for (TaskBase taskClassObject : taskClassObjects) { Class<? extends TaskBase> claz = taskClassObject.getClass(); for (Method method : claz.getDeclaredMethods()) { for (Annotation annotation : method.getAnnotations()) { ...
[ "private", "void", "initializeMappingTable", "(", ")", "{", "for", "(", "TaskBase", "taskClassObject", ":", "taskClassObjects", ")", "{", "Class", "<", "?", "extends", "TaskBase", ">", "claz", "=", "taskClassObject", ".", "getClass", "(", ")", ";", "for", "(...
Creates the table mapping method names and versions to Method objects and corresponding TaskBase objects
[ "Creates", "the", "table", "mapping", "method", "names", "and", "versions", "to", "Method", "objects", "and", "corresponding", "TaskBase", "objects" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/TaskSweeper.java#L249-L269
131,956
pravega/pravega
controller/src/main/java/io/pravega/controller/util/ZKUtils.java
ZKUtils.createPathIfNotExists
public static void createPathIfNotExists(final CuratorFramework client, final String basePath, final byte[] initData) { Preconditions.checkNotNull(client, "client"); Preconditions.checkNotNull(basePath, "basePath"); Preconditions.checkNotNull(initData, "initData"); try { ...
java
public static void createPathIfNotExists(final CuratorFramework client, final String basePath, final byte[] initData) { Preconditions.checkNotNull(client, "client"); Preconditions.checkNotNull(basePath, "basePath"); Preconditions.checkNotNull(initData, "initData"); try { ...
[ "public", "static", "void", "createPathIfNotExists", "(", "final", "CuratorFramework", "client", ",", "final", "String", "basePath", ",", "final", "byte", "[", "]", "initData", ")", "{", "Preconditions", ".", "checkNotNull", "(", "client", ",", "\"client\"", ")"...
Creates the znode if is doesn't already exist in zookeeper. @param client The curator client to access zookeeper. @param basePath The znode path string. @param initData Initialize the znode using the supplied data if not already created. @throws RuntimeException If checking...
[ "Creates", "the", "znode", "if", "is", "doesn", "t", "already", "exist", "in", "zookeeper", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/util/ZKUtils.java#L33-L48
131,957
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ThrottlerCalculator.java
ThrottlerCalculator.getThrottlingDelay
DelayResult getThrottlingDelay() { // These delays are not additive. There's no benefit to adding a batching delay on top of a throttling delay, since // a throttling delay will have increased batching as a side effect. int maxDelay = 0; boolean maximum = false; for (Throttler t ...
java
DelayResult getThrottlingDelay() { // These delays are not additive. There's no benefit to adding a batching delay on top of a throttling delay, since // a throttling delay will have increased batching as a side effect. int maxDelay = 0; boolean maximum = false; for (Throttler t ...
[ "DelayResult", "getThrottlingDelay", "(", ")", "{", "// These delays are not additive. There's no benefit to adding a batching delay on top of a throttling delay, since", "// a throttling delay will have increased batching as a side effect.", "int", "maxDelay", "=", "0", ";", "boolean", "m...
Calculates the amount of time needed to delay based on the configured throttlers. The computed result is not additive, as there is no benefit to adding delays from various Throttle Calculators together. For example, a cache throttling delay will have increased batching as a side effect, so there's no need to include th...
[ "Calculates", "the", "amount", "of", "time", "needed", "to", "delay", "based", "on", "the", "configured", "throttlers", ".", "The", "computed", "result", "is", "not", "additive", "as", "there", "is", "no", "benefit", "to", "adding", "delays", "from", "variou...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ThrottlerCalculator.java#L91-L109
131,958
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/rocksdb/RocksDBCache.java
RocksDBCache.initialize
void initialize() { Preconditions.checkState(this.database.get() == null, "%s has already been initialized.", this.logId); try { clear(true); this.database.set(openDatabase()); } catch (Exception ex) { // Make sure we cleanup anything we may have created in c...
java
void initialize() { Preconditions.checkState(this.database.get() == null, "%s has already been initialized.", this.logId); try { clear(true); this.database.set(openDatabase()); } catch (Exception ex) { // Make sure we cleanup anything we may have created in c...
[ "void", "initialize", "(", ")", "{", "Preconditions", ".", "checkState", "(", "this", ".", "database", ".", "get", "(", ")", "==", "null", ",", "\"%s has already been initialized.\"", ",", "this", ".", "logId", ")", ";", "try", "{", "clear", "(", "true", ...
Initializes this instance of the RocksDB cache. This method must be invoked before the cache can be used.
[ "Initializes", "this", "instance", "of", "the", "RocksDB", "cache", ".", "This", "method", "must", "be", "invoked", "before", "the", "cache", "can", "be", "used", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/rocksdb/RocksDBCache.java#L118-L136
131,959
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/rocksdb/RocksDBCache.java
RocksDBCache.insert
@Override public void insert(Key key, byte[] data) { ensureInitializedAndNotClosed(); Timer timer = new Timer(); byte[] serializedKey = key.serialize(); try { this.database.get().put(this.writeOptions, serializedKey, data); } catch (RocksDBException ex) { ...
java
@Override public void insert(Key key, byte[] data) { ensureInitializedAndNotClosed(); Timer timer = new Timer(); byte[] serializedKey = key.serialize(); try { this.database.get().put(this.writeOptions, serializedKey, data); } catch (RocksDBException ex) { ...
[ "@", "Override", "public", "void", "insert", "(", "Key", "key", ",", "byte", "[", "]", "data", ")", "{", "ensureInitializedAndNotClosed", "(", ")", ";", "Timer", "timer", "=", "new", "Timer", "(", ")", ";", "byte", "[", "]", "serializedKey", "=", "key"...
region Cache Implementation
[ "region", "Cache", "Implementation" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/rocksdb/RocksDBCache.java#L173-L185
131,960
pravega/pravega
client/src/main/java/io/pravega/client/stream/impl/EventStreamWriterImpl.java
EventStreamWriterImpl.handleLogSealed
private void handleLogSealed(Segment segment) { sealedSegmentQueue.add(segment); retransmitPool.execute(() -> { Retry.indefinitelyWithExpBackoff(config.getInitalBackoffMillis(), config.getBackoffMultiple(), config.getMaxBackoffMillis(), ...
java
private void handleLogSealed(Segment segment) { sealedSegmentQueue.add(segment); retransmitPool.execute(() -> { Retry.indefinitelyWithExpBackoff(config.getInitalBackoffMillis(), config.getBackoffMultiple(), config.getMaxBackoffMillis(), ...
[ "private", "void", "handleLogSealed", "(", "Segment", "segment", ")", "{", "sealedSegmentQueue", ".", "add", "(", "segment", ")", ";", "retransmitPool", ".", "execute", "(", "(", ")", "->", "{", "Retry", ".", "indefinitelyWithExpBackoff", "(", "config", ".", ...
If a log sealed is encountered, we need to 1. Find the new segments to write to. 2. For each outstanding message find which new segment it should go to and send it there.
[ "If", "a", "log", "sealed", "is", "encountered", "we", "need", "to", "1", ".", "Find", "the", "new", "segments", "to", "write", "to", ".", "2", ".", "For", "each", "outstanding", "message", "find", "which", "new", "segment", "it", "should", "go", "to",...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/EventStreamWriterImpl.java#L138-L179
131,961
pravega/pravega
common/src/main/java/io/pravega/common/io/serialization/RevisionDataInputStream.java
RevisionDataInputStream.wrap
static RevisionDataInputStream wrap(InputStream inputStream) throws IOException { int bound = BitConverter.readInt(inputStream); return new RevisionDataInputStream(new BoundedInputStream(inputStream, bound)); }
java
static RevisionDataInputStream wrap(InputStream inputStream) throws IOException { int bound = BitConverter.readInt(inputStream); return new RevisionDataInputStream(new BoundedInputStream(inputStream, bound)); }
[ "static", "RevisionDataInputStream", "wrap", "(", "InputStream", "inputStream", ")", "throws", "IOException", "{", "int", "bound", "=", "BitConverter", ".", "readInt", "(", "inputStream", ")", ";", "return", "new", "RevisionDataInputStream", "(", "new", "BoundedInpu...
Creates a new instance of the RevisionDataInputStream class. Upon a successful call to this method, 4 bytes will have been read from the InputStream representing the expected length of the serialization. @param inputStream The InputStream to wrap. @throws IOException If an IO Exception occurred.
[ "Creates", "a", "new", "instance", "of", "the", "RevisionDataInputStream", "class", ".", "Upon", "a", "successful", "call", "to", "this", "method", "4", "bytes", "will", "have", "been", "read", "from", "the", "InputStream", "representing", "the", "expected", "...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/serialization/RevisionDataInputStream.java#L56-L59
131,962
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.createStream
public void createStream(String scope, String streamName, int minNumSegments, Duration latency) { DYNAMIC_LOGGER.incCounterValue(CREATE_STREAM, 1); DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, 0, streamTags(scope, streamName)); DYNAMIC_LOGGER.reportGaugeValue(SEGMENTS_COUNT, minNumSegments...
java
public void createStream(String scope, String streamName, int minNumSegments, Duration latency) { DYNAMIC_LOGGER.incCounterValue(CREATE_STREAM, 1); DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, 0, streamTags(scope, streamName)); DYNAMIC_LOGGER.reportGaugeValue(SEGMENTS_COUNT, minNumSegments...
[ "public", "void", "createStream", "(", "String", "scope", ",", "String", "streamName", ",", "int", "minNumSegments", ",", "Duration", "latency", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "CREATE_STREAM", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", ...
This method increments the global and Stream-specific counters of Stream creations, initializes other stream-specific metrics and reports the latency of the operation. @param scope Scope. @param streamName Name of the Stream. @param minNumSegments Initial number of segments for the Stream. @param...
[ "This", "method", "increments", "the", "global", "and", "Stream", "-", "specific", "counters", "of", "Stream", "creations", "initializes", "other", "stream", "-", "specific", "metrics", "and", "reports", "the", "latency", "of", "the", "operation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L58-L66
131,963
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.createStreamFailed
public void createStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(CREATE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(CREATE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
java
public void createStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(CREATE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(CREATE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
[ "public", "void", "createStreamFailed", "(", "String", "scope", ",", "String", "streamName", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "CREATE_STREAM_FAILED", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", "incCounterValue", ...
This method increments the global counter of failed Stream creations in the system as well as the failed creation attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream.
[ "This", "method", "increments", "the", "global", "counter", "of", "failed", "Stream", "creations", "in", "the", "system", "as", "well", "as", "the", "failed", "creation", "attempts", "for", "this", "specific", "Stream", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L75-L78
131,964
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.deleteStream
public void deleteStream(String scope, String streamName, Duration latency) { DYNAMIC_LOGGER.incCounterValue(DELETE_STREAM, 1); deleteStreamLatency.reportSuccessValue(latency.toMillis()); }
java
public void deleteStream(String scope, String streamName, Duration latency) { DYNAMIC_LOGGER.incCounterValue(DELETE_STREAM, 1); deleteStreamLatency.reportSuccessValue(latency.toMillis()); }
[ "public", "void", "deleteStream", "(", "String", "scope", ",", "String", "streamName", ",", "Duration", "latency", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "DELETE_STREAM", ",", "1", ")", ";", "deleteStreamLatency", ".", "reportSuccessValue", "(", ...
This method increments the global and Stream-specific counters of Stream deletions and reports the latency of the operation. @param scope Scope. @param streamName Name of the Stream. @param latency Latency of the deleteStream operation.
[ "This", "method", "increments", "the", "global", "and", "Stream", "-", "specific", "counters", "of", "Stream", "deletions", "and", "reports", "the", "latency", "of", "the", "operation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L88-L91
131,965
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.deleteStreamFailed
public void deleteStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(DELETE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(DELETE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
java
public void deleteStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(DELETE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(DELETE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
[ "public", "void", "deleteStreamFailed", "(", "String", "scope", ",", "String", "streamName", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "DELETE_STREAM_FAILED", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", "incCounterValue", ...
This method increments the counter of failed Stream deletions in the system as well as the failed deletion attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream.
[ "This", "method", "increments", "the", "counter", "of", "failed", "Stream", "deletions", "in", "the", "system", "as", "well", "as", "the", "failed", "deletion", "attempts", "for", "this", "specific", "Stream", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L100-L103
131,966
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.sealStream
public void sealStream(String scope, String streamName, Duration latency) { DYNAMIC_LOGGER.incCounterValue(SEAL_STREAM, 1); DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, 0, streamTags(scope, streamName)); sealStreamLatency.reportSuccessValue(latency.toMillis()); }
java
public void sealStream(String scope, String streamName, Duration latency) { DYNAMIC_LOGGER.incCounterValue(SEAL_STREAM, 1); DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, 0, streamTags(scope, streamName)); sealStreamLatency.reportSuccessValue(latency.toMillis()); }
[ "public", "void", "sealStream", "(", "String", "scope", ",", "String", "streamName", ",", "Duration", "latency", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "SEAL_STREAM", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", "reportGaugeValue", "(", "OPEN_TRA...
This method increments the global and Stream-specific counters of seal Stream operations, set the number of open Transactions to 0, and reports the latency of the operation. @param scope Scope. @param streamName Name of the Stream. @param latency Latency of the sealStream operation.
[ "This", "method", "increments", "the", "global", "and", "Stream", "-", "specific", "counters", "of", "seal", "Stream", "operations", "set", "the", "number", "of", "open", "Transactions", "to", "0", "and", "reports", "the", "latency", "of", "the", "operation", ...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L113-L117
131,967
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.sealStreamFailed
public void sealStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(SEAL_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(SEAL_STREAM_FAILED, 1, streamTags(scope, streamName)); }
java
public void sealStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(SEAL_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(SEAL_STREAM_FAILED, 1, streamTags(scope, streamName)); }
[ "public", "void", "sealStreamFailed", "(", "String", "scope", ",", "String", "streamName", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "SEAL_STREAM_FAILED", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", "incCounterValue", "(...
This method increments the counter of failed Stream seal operations in the system as well as the failed seal attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream.
[ "This", "method", "increments", "the", "counter", "of", "failed", "Stream", "seal", "operations", "in", "the", "system", "as", "well", "as", "the", "failed", "seal", "attempts", "for", "this", "specific", "Stream", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L126-L129
131,968
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.updateStream
public void updateStream(String scope, String streamName, Duration latency) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(UPDATE_STREAM), 1); DYNAMIC_LOGGER.incCounterValue(UPDATE_STREAM, 1, streamTags(scope, streamName)); updateStreamLatency.reportSuccessValue(latency.toMillis()); }
java
public void updateStream(String scope, String streamName, Duration latency) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(UPDATE_STREAM), 1); DYNAMIC_LOGGER.incCounterValue(UPDATE_STREAM, 1, streamTags(scope, streamName)); updateStreamLatency.reportSuccessValue(latency.toMillis()); }
[ "public", "void", "updateStream", "(", "String", "scope", ",", "String", "streamName", ",", "Duration", "latency", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "UPDATE_STREAM", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", ...
This method increments the global and Stream-specific counters of Stream updates and reports the latency of the operation. @param scope Scope. @param streamName Name of the Stream. @param latency Latency of the updateStream operation.
[ "This", "method", "increments", "the", "global", "and", "Stream", "-", "specific", "counters", "of", "Stream", "updates", "and", "reports", "the", "latency", "of", "the", "operation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L139-L143
131,969
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.updateStreamFailed
public void updateStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(UPDATE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(UPDATE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
java
public void updateStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(UPDATE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(UPDATE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
[ "public", "void", "updateStreamFailed", "(", "String", "scope", ",", "String", "streamName", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "UPDATE_STREAM_FAILED", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", "incCounterValue", ...
This method increments the counter of failed Stream update operations in the system as well as the failed update attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream.
[ "This", "method", "increments", "the", "counter", "of", "failed", "Stream", "update", "operations", "in", "the", "system", "as", "well", "as", "the", "failed", "update", "attempts", "for", "this", "specific", "Stream", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L152-L155
131,970
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.truncateStream
public void truncateStream(String scope, String streamName, Duration latency) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(TRUNCATE_STREAM), 1); DYNAMIC_LOGGER.incCounterValue(TRUNCATE_STREAM, 1, streamTags(scope, streamName)); truncateStreamLatency.reportSuccessValue(latency.toMillis()); ...
java
public void truncateStream(String scope, String streamName, Duration latency) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(TRUNCATE_STREAM), 1); DYNAMIC_LOGGER.incCounterValue(TRUNCATE_STREAM, 1, streamTags(scope, streamName)); truncateStreamLatency.reportSuccessValue(latency.toMillis()); ...
[ "public", "void", "truncateStream", "(", "String", "scope", ",", "String", "streamName", ",", "Duration", "latency", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "TRUNCATE_STREAM", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", "...
This method increments the global and Stream-specific counters of Stream truncations and reports the latency of the operation. @param scope Scope. @param streamName Name of the Stream. @param latency Latency of the truncateStream operation.
[ "This", "method", "increments", "the", "global", "and", "Stream", "-", "specific", "counters", "of", "Stream", "truncations", "and", "reports", "the", "latency", "of", "the", "operation", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L165-L169
131,971
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.truncateStreamFailed
public void truncateStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(TRUNCATE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(TRUNCATE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
java
public void truncateStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(TRUNCATE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(TRUNCATE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
[ "public", "void", "truncateStreamFailed", "(", "String", "scope", ",", "String", "streamName", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "TRUNCATE_STREAM_FAILED", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", "incCounterValu...
This method increments the counter of failed Stream truncate operations in the system as well as the failed truncate attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream.
[ "This", "method", "increments", "the", "counter", "of", "failed", "Stream", "truncate", "operations", "in", "the", "system", "as", "well", "as", "the", "failed", "truncate", "attempts", "for", "this", "specific", "Stream", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L178-L181
131,972
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.reportRetentionEvent
public static void reportRetentionEvent(String scope, String streamName) { DYNAMIC_LOGGER.recordMeterEvents(RETENTION_FREQUENCY, 1, streamTags(scope, streamName)); }
java
public static void reportRetentionEvent(String scope, String streamName) { DYNAMIC_LOGGER.recordMeterEvents(RETENTION_FREQUENCY, 1, streamTags(scope, streamName)); }
[ "public", "static", "void", "reportRetentionEvent", "(", "String", "scope", ",", "String", "streamName", ")", "{", "DYNAMIC_LOGGER", ".", "recordMeterEvents", "(", "RETENTION_FREQUENCY", ",", "1", ",", "streamTags", "(", "scope", ",", "streamName", ")", ")", ";"...
This method increments the Stream-specific counter of retention operations. @param scope Scope. @param streamName Name of the Stream.
[ "This", "method", "increments", "the", "Stream", "-", "specific", "counter", "of", "retention", "operations", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L189-L191
131,973
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.reportActiveSegments
public static void reportActiveSegments(String scope, String streamName, int numSegments) { DYNAMIC_LOGGER.reportGaugeValue(SEGMENTS_COUNT, numSegments, streamTags(scope, streamName)); }
java
public static void reportActiveSegments(String scope, String streamName, int numSegments) { DYNAMIC_LOGGER.reportGaugeValue(SEGMENTS_COUNT, numSegments, streamTags(scope, streamName)); }
[ "public", "static", "void", "reportActiveSegments", "(", "String", "scope", ",", "String", "streamName", ",", "int", "numSegments", ")", "{", "DYNAMIC_LOGGER", ".", "reportGaugeValue", "(", "SEGMENTS_COUNT", ",", "numSegments", ",", "streamTags", "(", "scope", ","...
Reports the number of active segments for a Stream. @param scope Scope. @param streamName Name of the Stream. @param numSegments Number of active segments in this Stream.
[ "Reports", "the", "number", "of", "active", "segments", "for", "a", "Stream", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L200-L202
131,974
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.reportSegmentSplitsAndMerges
public static void reportSegmentSplitsAndMerges(String scope, String streamName, long splits, long merges) { DYNAMIC_LOGGER.updateCounterValue(globalMetricName(SEGMENTS_SPLITS), splits); DYNAMIC_LOGGER.updateCounterValue(SEGMENTS_SPLITS, splits, streamTags(scope, streamName)); DYNAMIC_LOGGER.upd...
java
public static void reportSegmentSplitsAndMerges(String scope, String streamName, long splits, long merges) { DYNAMIC_LOGGER.updateCounterValue(globalMetricName(SEGMENTS_SPLITS), splits); DYNAMIC_LOGGER.updateCounterValue(SEGMENTS_SPLITS, splits, streamTags(scope, streamName)); DYNAMIC_LOGGER.upd...
[ "public", "static", "void", "reportSegmentSplitsAndMerges", "(", "String", "scope", ",", "String", "streamName", ",", "long", "splits", ",", "long", "merges", ")", "{", "DYNAMIC_LOGGER", ".", "updateCounterValue", "(", "globalMetricName", "(", "SEGMENTS_SPLITS", ")"...
Reports the number of segment splits and merges related to a particular scale operation on a Stream. Both global and Stream-specific counters are updated. @param scope Scope. @param streamName Name of the Stream. @param splits Number of segment splits in the scale operation. @param merges Numb...
[ "Reports", "the", "number", "of", "segment", "splits", "and", "merges", "related", "to", "a", "particular", "scale", "operation", "on", "a", "Stream", ".", "Both", "global", "and", "Stream", "-", "specific", "counters", "are", "updated", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L213-L218
131,975
pravega/pravega
bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java
HDFSStorage.asWritableHandle
private HDFSSegmentHandle asWritableHandle(SegmentHandle handle) { Preconditions.checkArgument(!handle.isReadOnly(), "handle must not be read-only."); return asReadableHandle(handle); }
java
private HDFSSegmentHandle asWritableHandle(SegmentHandle handle) { Preconditions.checkArgument(!handle.isReadOnly(), "handle must not be read-only."); return asReadableHandle(handle); }
[ "private", "HDFSSegmentHandle", "asWritableHandle", "(", "SegmentHandle", "handle", ")", "{", "Preconditions", ".", "checkArgument", "(", "!", "handle", ".", "isReadOnly", "(", ")", ",", "\"handle must not be read-only.\"", ")", ";", "return", "asReadableHandle", "(",...
Casts the given handle as a HDFSSegmentHandle that has isReadOnly == false.
[ "Casts", "the", "given", "handle", "as", "a", "HDFSSegmentHandle", "that", "has", "isReadOnly", "==", "false", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java#L493-L496
131,976
pravega/pravega
bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java
HDFSStorage.asReadableHandle
private HDFSSegmentHandle asReadableHandle(SegmentHandle handle) { Preconditions.checkArgument(handle instanceof HDFSSegmentHandle, "handle must be of type HDFSSegmentHandle."); return (HDFSSegmentHandle) handle; }
java
private HDFSSegmentHandle asReadableHandle(SegmentHandle handle) { Preconditions.checkArgument(handle instanceof HDFSSegmentHandle, "handle must be of type HDFSSegmentHandle."); return (HDFSSegmentHandle) handle; }
[ "private", "HDFSSegmentHandle", "asReadableHandle", "(", "SegmentHandle", "handle", ")", "{", "Preconditions", ".", "checkArgument", "(", "handle", "instanceof", "HDFSSegmentHandle", ",", "\"handle must be of type HDFSSegmentHandle.\"", ")", ";", "return", "(", "HDFSSegment...
Casts the given handle as a HDFSSegmentHandle irrespective of its isReadOnly value.
[ "Casts", "the", "given", "handle", "as", "a", "HDFSSegmentHandle", "irrespective", "of", "its", "isReadOnly", "value", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java#L501-L504
131,977
pravega/pravega
bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java
HDFSStorage.getFilePath
private Path getFilePath(String segmentName, long epoch) { Preconditions.checkState(segmentName != null && segmentName.length() > 0, "segmentName must be non-null and non-empty"); Preconditions.checkState(epoch >= 0, "epoch must be non-negative " + epoch); return new Path(String.format(NAME_FORM...
java
private Path getFilePath(String segmentName, long epoch) { Preconditions.checkState(segmentName != null && segmentName.length() > 0, "segmentName must be non-null and non-empty"); Preconditions.checkState(epoch >= 0, "epoch must be non-negative " + epoch); return new Path(String.format(NAME_FORM...
[ "private", "Path", "getFilePath", "(", "String", "segmentName", ",", "long", "epoch", ")", "{", "Preconditions", ".", "checkState", "(", "segmentName", "!=", "null", "&&", "segmentName", ".", "length", "(", ")", ">", "0", ",", "\"segmentName must be non-null and...
Gets the full HDFS Path to a file for the given Segment, startOffset and epoch.
[ "Gets", "the", "full", "HDFS", "Path", "to", "a", "file", "for", "the", "given", "Segment", "startOffset", "and", "epoch", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java#L540-L544
131,978
pravega/pravega
bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java
HDFSStorage.getSealedFilePath
private Path getSealedFilePath(String segmentName) { Preconditions.checkState(segmentName != null && segmentName.length() > 0, "segmentName must be non-null and non-empty"); return new Path(String.format(NAME_FORMAT, getPathPrefix(segmentName), SEALED)); }
java
private Path getSealedFilePath(String segmentName) { Preconditions.checkState(segmentName != null && segmentName.length() > 0, "segmentName must be non-null and non-empty"); return new Path(String.format(NAME_FORMAT, getPathPrefix(segmentName), SEALED)); }
[ "private", "Path", "getSealedFilePath", "(", "String", "segmentName", ")", "{", "Preconditions", ".", "checkState", "(", "segmentName", "!=", "null", "&&", "segmentName", ".", "length", "(", ")", ">", "0", ",", "\"segmentName must be non-null and non-empty\"", ")", ...
Gets the full HDFS path when sealed.
[ "Gets", "the", "full", "HDFS", "path", "when", "sealed", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java#L549-L552
131,979
pravega/pravega
bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java
HDFSStorage.findStatusForSegment
private FileStatus findStatusForSegment(String segmentName, boolean enforceExistence) throws IOException { FileStatus[] rawFiles = findAllRaw(segmentName); if (rawFiles == null || rawFiles.length == 0) { if (enforceExistence) { throw HDFSExceptionHelpers.segmentNotExistsExcep...
java
private FileStatus findStatusForSegment(String segmentName, boolean enforceExistence) throws IOException { FileStatus[] rawFiles = findAllRaw(segmentName); if (rawFiles == null || rawFiles.length == 0) { if (enforceExistence) { throw HDFSExceptionHelpers.segmentNotExistsExcep...
[ "private", "FileStatus", "findStatusForSegment", "(", "String", "segmentName", ",", "boolean", "enforceExistence", ")", "throws", "IOException", "{", "FileStatus", "[", "]", "rawFiles", "=", "findAllRaw", "(", "segmentName", ")", ";", "if", "(", "rawFiles", "==", ...
Gets the filestatus representing the segment. @param segmentName The name of the Segment to retrieve for. @param enforceExistence If true, it will throw a FileNotFoundException if no files are found, otherwise null is returned. @return FileStatus of the HDFS file. @throws IOException If an exception occurred.
[ "Gets", "the", "filestatus", "representing", "the", "segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java#L563-L577
131,980
pravega/pravega
bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java
HDFSStorage.makeReadOnly
private boolean makeReadOnly(FileStatus file) throws IOException { if (isReadOnly(file)) { return false; } this.fileSystem.setPermission(file.getPath(), READONLY_PERMISSION); log.debug("MakeReadOnly '{}'.", file.getPath()); return true; }
java
private boolean makeReadOnly(FileStatus file) throws IOException { if (isReadOnly(file)) { return false; } this.fileSystem.setPermission(file.getPath(), READONLY_PERMISSION); log.debug("MakeReadOnly '{}'.", file.getPath()); return true; }
[ "private", "boolean", "makeReadOnly", "(", "FileStatus", "file", ")", "throws", "IOException", "{", "if", "(", "isReadOnly", "(", "file", ")", ")", "{", "return", "false", ";", "}", "this", ".", "fileSystem", ".", "setPermission", "(", "file", ".", "getPat...
Makes the file represented by the given FileStatus read-only. @param file The FileDescriptor of the file to set. If this method returns true, this FileDescriptor will also be updated to indicate the file is read-only. @return True if the file was not read-only before (and it is now), or false if the file was already r...
[ "Makes", "the", "file", "represented", "by", "the", "given", "FileStatus", "read", "-", "only", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/hdfs/HDFSStorage.java#L626-L634
131,981
pravega/pravega
common/src/main/java/io/pravega/common/io/FileHelpers.java
FileHelpers.deleteFileOrDirectory
public static boolean deleteFileOrDirectory(File file) { if (file.exists() && file.isDirectory()) { File[] files = file.listFiles(); if (files != null) { for (File f : files) { deleteFileOrDirectory(f); } } } ...
java
public static boolean deleteFileOrDirectory(File file) { if (file.exists() && file.isDirectory()) { File[] files = file.listFiles(); if (files != null) { for (File f : files) { deleteFileOrDirectory(f); } } } ...
[ "public", "static", "boolean", "deleteFileOrDirectory", "(", "File", "file", ")", "{", "if", "(", "file", ".", "exists", "(", ")", "&&", "file", ".", "isDirectory", "(", ")", ")", "{", "File", "[", "]", "files", "=", "file", ".", "listFiles", "(", ")...
Deletes the given file or directory. If a directory, recursively deletes all sub-directories and files. @param file The target to delete. @return True if the target was deleted, false otherwise.
[ "Deletes", "the", "given", "file", "or", "directory", ".", "If", "a", "directory", "recursively", "deletes", "all", "sub", "-", "directories", "and", "files", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/FileHelpers.java#L24-L35
131,982
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/mocks/LocalSegmentContainerManager.java
LocalSegmentContainerManager.initialize
@Override public void initialize() { Exceptions.checkNotClosed(this.closed.get(), this); long traceId = LoggerHelpers.traceEnter(log, "initialize"); long containerCount = this.segmentToContainerMapper.getTotalContainerCount(); ArrayList<CompletableFuture<Void>> futures = new ArrayLis...
java
@Override public void initialize() { Exceptions.checkNotClosed(this.closed.get(), this); long traceId = LoggerHelpers.traceEnter(log, "initialize"); long containerCount = this.segmentToContainerMapper.getTotalContainerCount(); ArrayList<CompletableFuture<Void>> futures = new ArrayLis...
[ "@", "Override", "public", "void", "initialize", "(", ")", "{", "Exceptions", ".", "checkNotClosed", "(", "this", ".", "closed", ".", "get", "(", ")", ",", "this", ")", ";", "long", "traceId", "=", "LoggerHelpers", ".", "traceEnter", "(", "log", ",", "...
region SegmentContainerManager Implementation
[ "region", "SegmentContainerManager", "Implementation" ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/mocks/LocalSegmentContainerManager.java#L100-L113
131,983
pravega/pravega
shared/metrics/src/main/java/io/pravega/shared/MetricsNames.java
MetricsNames.failMetricName
public static String failMetricName(String metricName) { if (Strings.isNullOrEmpty(metricName)) { return metricName; } String[] tags = metricName.split("\\."); if (tags.length >= 2 && Ints.tryParse(tags[tags.length - 1]) != null) { tags[tags.length - 2] += "_fail"...
java
public static String failMetricName(String metricName) { if (Strings.isNullOrEmpty(metricName)) { return metricName; } String[] tags = metricName.split("\\."); if (tags.length >= 2 && Ints.tryParse(tags[tags.length - 1]) != null) { tags[tags.length - 2] += "_fail"...
[ "public", "static", "String", "failMetricName", "(", "String", "metricName", ")", "{", "if", "(", "Strings", ".", "isNullOrEmpty", "(", "metricName", ")", ")", "{", "return", "metricName", ";", "}", "String", "[", "]", "tags", "=", "metricName", ".", "spli...
For some metrics such as OpStats, Pravega generates corresponding fail metrics automatically, this method is called to create the name of fail metric for a given metric. Some examples of OpStats metrics and their corresponding fail metrics: pravega.segmentstore.bookkeeper.write_latency_ms.0 pravega.segmentstore.bookke...
[ "For", "some", "metrics", "such", "as", "OpStats", "Pravega", "generates", "corresponding", "fail", "metrics", "automatically", "this", "method", "is", "called", "to", "create", "the", "name", "of", "fail", "metric", "for", "a", "given", "metric", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/metrics/src/main/java/io/pravega/shared/MetricsNames.java#L223-L234
131,984
pravega/pravega
shared/metrics/src/main/java/io/pravega/shared/MetricsNames.java
MetricsNames.metricKey
public static MetricKey metricKey(String metric, String... tags) { if (tags == null || tags.length == 0) { //if no tags supplied, the original metric name is used for both cache key and registry key. return new MetricKey(metric, metric); } else { //if tag is supplied, append tag value to f...
java
public static MetricKey metricKey(String metric, String... tags) { if (tags == null || tags.length == 0) { //if no tags supplied, the original metric name is used for both cache key and registry key. return new MetricKey(metric, metric); } else { //if tag is supplied, append tag value to f...
[ "public", "static", "MetricKey", "metricKey", "(", "String", "metric", ",", "String", "...", "tags", ")", "{", "if", "(", "tags", "==", "null", "||", "tags", ".", "length", "==", "0", ")", "{", "//if no tags supplied, the original metric name is used for both cach...
Create an MetricKey object based on metric name, metric type and tags associated. The MetricKey object contains cache key for cache lookup and registry key for registry lookup. @param metric the metric name. @param tags the tag(s) associated with the metric. @return the MetricKey object contains cache lookup key and m...
[ "Create", "an", "MetricKey", "object", "based", "on", "metric", "name", "metric", "type", "and", "tags", "associated", ".", "The", "MetricKey", "object", "contains", "cache", "key", "for", "cache", "lookup", "and", "registry", "key", "for", "registry", "lookup...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/metrics/src/main/java/io/pravega/shared/MetricsNames.java#L244-L257
131,985
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getTransactionNameFromId
public static String getTransactionNameFromId(String parentStreamSegmentName, UUID transactionId) { StringBuilder result = new StringBuilder(); result.append(parentStreamSegmentName); result.append(TRANSACTION_DELIMITER); result.append(String.format(FULL_HEX_FORMAT, transactionId.getMost...
java
public static String getTransactionNameFromId(String parentStreamSegmentName, UUID transactionId) { StringBuilder result = new StringBuilder(); result.append(parentStreamSegmentName); result.append(TRANSACTION_DELIMITER); result.append(String.format(FULL_HEX_FORMAT, transactionId.getMost...
[ "public", "static", "String", "getTransactionNameFromId", "(", "String", "parentStreamSegmentName", ",", "UUID", "transactionId", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "result", ".", "append", "(", "parentStreamSegmentName", ...
Returns the transaction name for a TransactionStreamSegment based on the name of the current Parent StreamSegment, and the transactionId. @param parentStreamSegmentName The name of the Parent StreamSegment for this transaction. @param transactionId The unique Id for the transaction. @return The name of the T...
[ "Returns", "the", "transaction", "name", "for", "a", "TransactionStreamSegment", "based", "on", "the", "name", "of", "the", "current", "Parent", "StreamSegment", "and", "the", "transactionId", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L83-L90
131,986
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getParentStreamSegmentName
public static String getParentStreamSegmentName(String transactionName) { // Check to see if the given name is a properly formatted Transaction. int endOfStreamNamePos = transactionName.lastIndexOf(TRANSACTION_DELIMITER); if (endOfStreamNamePos < 0 || endOfStreamNamePos + TRANSACTION_DELIMITER.l...
java
public static String getParentStreamSegmentName(String transactionName) { // Check to see if the given name is a properly formatted Transaction. int endOfStreamNamePos = transactionName.lastIndexOf(TRANSACTION_DELIMITER); if (endOfStreamNamePos < 0 || endOfStreamNamePos + TRANSACTION_DELIMITER.l...
[ "public", "static", "String", "getParentStreamSegmentName", "(", "String", "transactionName", ")", "{", "// Check to see if the given name is a properly formatted Transaction.", "int", "endOfStreamNamePos", "=", "transactionName", ".", "lastIndexOf", "(", "TRANSACTION_DELIMITER", ...
Attempts to extract the name of the Parent StreamSegment for the given Transaction StreamSegment. This method returns a valid value only if the Transaction StreamSegmentName was generated using the generateTransactionStreamSegmentName method. @param transactionName The name of the Transaction StreamSegment to extract ...
[ "Attempts", "to", "extract", "the", "name", "of", "the", "Parent", "StreamSegment", "for", "the", "given", "Transaction", "StreamSegment", ".", "This", "method", "returns", "a", "valid", "value", "only", "if", "the", "Transaction", "StreamSegmentName", "was", "g...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L99-L107
131,987
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.isTransactionSegment
public static boolean isTransactionSegment(String streamSegmentName) { // Check to see if the given name is a properly formatted Transaction. int endOfStreamNamePos = streamSegmentName.lastIndexOf(TRANSACTION_DELIMITER); if (endOfStreamNamePos < 0 || endOfStreamNamePos + TRANSACTION_DELIMITER.le...
java
public static boolean isTransactionSegment(String streamSegmentName) { // Check to see if the given name is a properly formatted Transaction. int endOfStreamNamePos = streamSegmentName.lastIndexOf(TRANSACTION_DELIMITER); if (endOfStreamNamePos < 0 || endOfStreamNamePos + TRANSACTION_DELIMITER.le...
[ "public", "static", "boolean", "isTransactionSegment", "(", "String", "streamSegmentName", ")", "{", "// Check to see if the given name is a properly formatted Transaction.", "int", "endOfStreamNamePos", "=", "streamSegmentName", ".", "lastIndexOf", "(", "TRANSACTION_DELIMITER", ...
Checks if the given stream segment name is formatted for a Transaction Segment or regular segment. @param streamSegmentName The name of the StreamSegment to check for transaction delimiter. @return true if stream segment name contains transaction delimiter, false otherwise.
[ "Checks", "if", "the", "given", "stream", "segment", "name", "is", "formatted", "for", "a", "Transaction", "Segment", "or", "regular", "segment", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L115-L122
131,988
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.extractPrimaryStreamSegmentName
public static String extractPrimaryStreamSegmentName(String streamSegmentName) { if (isTransactionSegment(streamSegmentName)) { return extractPrimaryStreamSegmentName(getParentStreamSegmentName(streamSegmentName)); } int endOfStreamNamePos = streamSegmentName.lastIndexOf(EPOCH_DELIMI...
java
public static String extractPrimaryStreamSegmentName(String streamSegmentName) { if (isTransactionSegment(streamSegmentName)) { return extractPrimaryStreamSegmentName(getParentStreamSegmentName(streamSegmentName)); } int endOfStreamNamePos = streamSegmentName.lastIndexOf(EPOCH_DELIMI...
[ "public", "static", "String", "extractPrimaryStreamSegmentName", "(", "String", "streamSegmentName", ")", "{", "if", "(", "isTransactionSegment", "(", "streamSegmentName", ")", ")", "{", "return", "extractPrimaryStreamSegmentName", "(", "getParentStreamSegmentName", "(", ...
Attempts to extract the primary part of stream segment name before the epoch delimiter. This method returns a valid value only if the StreamSegmentName was generated using the getQualifiedStreamSegmentName method. @param streamSegmentName The name of the StreamSegment to extract the name of the Primary StreamSegment n...
[ "Attempts", "to", "extract", "the", "primary", "part", "of", "stream", "segment", "name", "before", "the", "epoch", "delimiter", ".", "This", "method", "returns", "a", "valid", "value", "only", "if", "the", "StreamSegmentName", "was", "generated", "using", "th...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L131-L141
131,989
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getAttributeSegmentName
public static String getAttributeSegmentName(String segmentName) { Preconditions.checkArgument(!segmentName.endsWith(ATTRIBUTE_SUFFIX), "segmentName is already an attribute segment name"); return segmentName + ATTRIBUTE_SUFFIX; }
java
public static String getAttributeSegmentName(String segmentName) { Preconditions.checkArgument(!segmentName.endsWith(ATTRIBUTE_SUFFIX), "segmentName is already an attribute segment name"); return segmentName + ATTRIBUTE_SUFFIX; }
[ "public", "static", "String", "getAttributeSegmentName", "(", "String", "segmentName", ")", "{", "Preconditions", ".", "checkArgument", "(", "!", "segmentName", ".", "endsWith", "(", "ATTRIBUTE_SUFFIX", ")", ",", "\"segmentName is already an attribute segment name\"", ")"...
Gets the name of the meta-Segment mapped to the given Segment Name that is responsible with storing extended attributes. @param segmentName The name of the Segment to get the Attribute segment name for. @return The result.
[ "Gets", "the", "name", "of", "the", "meta", "-", "Segment", "mapped", "to", "the", "given", "Segment", "Name", "that", "is", "responsible", "with", "storing", "extended", "attributes", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L149-L152
131,990
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getHeaderSegmentName
public static String getHeaderSegmentName(String segmentName) { Preconditions.checkArgument(!segmentName.endsWith(HEADER_SUFFIX), "segmentName is already a segment header name"); return segmentName + HEADER_SUFFIX; }
java
public static String getHeaderSegmentName(String segmentName) { Preconditions.checkArgument(!segmentName.endsWith(HEADER_SUFFIX), "segmentName is already a segment header name"); return segmentName + HEADER_SUFFIX; }
[ "public", "static", "String", "getHeaderSegmentName", "(", "String", "segmentName", ")", "{", "Preconditions", ".", "checkArgument", "(", "!", "segmentName", ".", "endsWith", "(", "HEADER_SUFFIX", ")", ",", "\"segmentName is already a segment header name\"", ")", ";", ...
Gets the name of the meta-Segment mapped to the given Segment Name that is responsible with storing its Rollover information. Existence of this file should also indicate that a Segment with this file has a rollover policy in place. @param segmentName The name of the Segment to get the Header segment name for. @return ...
[ "Gets", "the", "name", "of", "the", "meta", "-", "Segment", "mapped", "to", "the", "given", "Segment", "Name", "that", "is", "responsible", "with", "storing", "its", "Rollover", "information", ".", "Existence", "of", "this", "file", "should", "also", "indica...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L162-L165
131,991
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getSegmentNameFromHeader
public static String getSegmentNameFromHeader(String headerSegmentName) { Preconditions.checkArgument(headerSegmentName.endsWith(HEADER_SUFFIX)); return headerSegmentName.substring(0, headerSegmentName.length() - HEADER_SUFFIX.length()); }
java
public static String getSegmentNameFromHeader(String headerSegmentName) { Preconditions.checkArgument(headerSegmentName.endsWith(HEADER_SUFFIX)); return headerSegmentName.substring(0, headerSegmentName.length() - HEADER_SUFFIX.length()); }
[ "public", "static", "String", "getSegmentNameFromHeader", "(", "String", "headerSegmentName", ")", "{", "Preconditions", ".", "checkArgument", "(", "headerSegmentName", ".", "endsWith", "(", "HEADER_SUFFIX", ")", ")", ";", "return", "headerSegmentName", ".", "substrin...
Gets the name of the Segment name from its Header Segment Name. @param headerSegmentName The name of the Header Segment. @return The Segment Name.
[ "Gets", "the", "name", "of", "the", "Segment", "name", "from", "its", "Header", "Segment", "Name", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L173-L176
131,992
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getSegmentChunkName
public static String getSegmentChunkName(String segmentName, long offset) { Preconditions.checkArgument(!segmentName.contains(OFFSET_SUFFIX), "segmentName is already a SegmentChunk name"); return segmentName + OFFSET_SUFFIX + Long.toString(offset); }
java
public static String getSegmentChunkName(String segmentName, long offset) { Preconditions.checkArgument(!segmentName.contains(OFFSET_SUFFIX), "segmentName is already a SegmentChunk name"); return segmentName + OFFSET_SUFFIX + Long.toString(offset); }
[ "public", "static", "String", "getSegmentChunkName", "(", "String", "segmentName", ",", "long", "offset", ")", "{", "Preconditions", ".", "checkArgument", "(", "!", "segmentName", ".", "contains", "(", "OFFSET_SUFFIX", ")", ",", "\"segmentName is already a SegmentChun...
Gets the name of the SegmentChunk for the given Segment and Offset. @param segmentName The name of the Segment to get the SegmentChunk name for. @param offset The starting offset of the SegmentChunk. @return The SegmentChunk name.
[ "Gets", "the", "name", "of", "the", "SegmentChunk", "for", "the", "given", "Segment", "and", "Offset", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L185-L188
131,993
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getMetadataSegmentName
public static String getMetadataSegmentName(int containerId) { Preconditions.checkArgument(containerId >= 0, "containerId must be a non-negative number."); return String.format(METADATA_SEGMENT_NAME_FORMAT, containerId); }
java
public static String getMetadataSegmentName(int containerId) { Preconditions.checkArgument(containerId >= 0, "containerId must be a non-negative number."); return String.format(METADATA_SEGMENT_NAME_FORMAT, containerId); }
[ "public", "static", "String", "getMetadataSegmentName", "(", "int", "containerId", ")", "{", "Preconditions", ".", "checkArgument", "(", "containerId", ">=", "0", ",", "\"containerId must be a non-negative number.\"", ")", ";", "return", "String", ".", "format", "(", ...
Gets the name of the Segment that is used to store the Container's Segment Metadata. There is one such Segment per container. @param containerId The Id of the Container. @return The Metadata Segment name.
[ "Gets", "the", "name", "of", "the", "Segment", "that", "is", "used", "to", "store", "the", "Container", "s", "Segment", "Metadata", ".", "There", "is", "one", "such", "Segment", "per", "container", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L197-L200
131,994
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.computeSegmentId
public static long computeSegmentId(int segmentNumber, int epoch) { Preconditions.checkArgument(segmentNumber >= 0); Preconditions.checkArgument(epoch >= 0); return (long) epoch << 32 | (segmentNumber & 0xFFFFFFFFL); }
java
public static long computeSegmentId(int segmentNumber, int epoch) { Preconditions.checkArgument(segmentNumber >= 0); Preconditions.checkArgument(epoch >= 0); return (long) epoch << 32 | (segmentNumber & 0xFFFFFFFFL); }
[ "public", "static", "long", "computeSegmentId", "(", "int", "segmentNumber", ",", "int", "epoch", ")", "{", "Preconditions", ".", "checkArgument", "(", "segmentNumber", ">=", "0", ")", ";", "Preconditions", ".", "checkArgument", "(", "epoch", ">=", "0", ")", ...
Method to compute 64 bit segment id which takes segment number and epoch and composes it as `msb = epoch` `lsb = segmentNumber`. Primary id identifies the segment container mapping and primary + secondary uniquely identifies a segment within a stream. @param segmentNumber segment number. @param epoch epoch in which se...
[ "Method", "to", "compute", "64", "bit", "segment", "id", "which", "takes", "segment", "number", "and", "epoch", "and", "composes", "it", "as", "msb", "=", "epoch", "lsb", "=", "segmentNumber", ".", "Primary", "id", "identifies", "the", "segment", "container"...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L212-L216
131,995
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getScopedStreamName
public static String getScopedStreamName(String scope, String streamName) { return getScopedStreamNameInternal(scope, streamName).toString(); }
java
public static String getScopedStreamName(String scope, String streamName) { return getScopedStreamNameInternal(scope, streamName).toString(); }
[ "public", "static", "String", "getScopedStreamName", "(", "String", "scope", ",", "String", "streamName", ")", "{", "return", "getScopedStreamNameInternal", "(", "scope", ",", "streamName", ")", ".", "toString", "(", ")", ";", "}" ]
Compose and return scoped stream name. @param scope scope to be used in ScopedStream name. @param streamName stream name to be used in ScopedStream name. @return scoped stream name.
[ "Compose", "and", "return", "scoped", "stream", "name", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L245-L247
131,996
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.getQualifiedStreamSegmentName
public static String getQualifiedStreamSegmentName(String scope, String streamName, long segmentId) { int segmentNumber = getSegmentNumber(segmentId); int epoch = getEpoch(segmentId); StringBuffer sb = getScopedStreamNameInternal(scope, streamName); sb.append('/'); sb.append(segm...
java
public static String getQualifiedStreamSegmentName(String scope, String streamName, long segmentId) { int segmentNumber = getSegmentNumber(segmentId); int epoch = getEpoch(segmentId); StringBuffer sb = getScopedStreamNameInternal(scope, streamName); sb.append('/'); sb.append(segm...
[ "public", "static", "String", "getQualifiedStreamSegmentName", "(", "String", "scope", ",", "String", "streamName", ",", "long", "segmentId", ")", "{", "int", "segmentNumber", "=", "getSegmentNumber", "(", "segmentId", ")", ";", "int", "epoch", "=", "getEpoch", ...
Method to generate Fully Qualified StreamSegmentName using scope, stream and segment id. @param scope scope to be used in the ScopedStreamSegment name @param streamName stream name to be used in ScopedStreamSegment name. @param segmentId segment id to be used in ScopedStreamSegment name. @return fully qualified Stream...
[ "Method", "to", "generate", "Fully", "Qualified", "StreamSegmentName", "using", "scope", "stream", "and", "segment", "id", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L257-L266
131,997
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.extractSegmentTokens
public static List<String> extractSegmentTokens(String qualifiedName) { Preconditions.checkNotNull(qualifiedName); String originalSegmentName = isTransactionSegment(qualifiedName) ? getParentStreamSegmentName(qualifiedName) : qualifiedName; List<String> retVal = new LinkedList<>(); Stri...
java
public static List<String> extractSegmentTokens(String qualifiedName) { Preconditions.checkNotNull(qualifiedName); String originalSegmentName = isTransactionSegment(qualifiedName) ? getParentStreamSegmentName(qualifiedName) : qualifiedName; List<String> retVal = new LinkedList<>(); Stri...
[ "public", "static", "List", "<", "String", ">", "extractSegmentTokens", "(", "String", "qualifiedName", ")", "{", "Preconditions", ".", "checkNotNull", "(", "qualifiedName", ")", ";", "String", "originalSegmentName", "=", "isTransactionSegment", "(", "qualifiedName", ...
Method to extract different parts of stream segment name. The tokens extracted are in following order scope, stream name and segment id. If its a transational segment, the transaction id is ignored. This function works even when scope is not set. @param qualifiedName StreamSegment's qualified name. @return tokens capt...
[ "Method", "to", "extract", "different", "parts", "of", "stream", "segment", "name", ".", "The", "tokens", "extracted", "are", "in", "following", "order", "scope", "stream", "name", "and", "segment", "id", ".", "If", "its", "a", "transational", "segment", "th...
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L278-L300
131,998
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.extractTableSegmentTokens
public static List<String> extractTableSegmentTokens(String qualifiedName) { Preconditions.checkNotNull(qualifiedName); List<String> retVal = new LinkedList<>(); String[] tokens = qualifiedName.split("[/]"); Preconditions.checkArgument(tokens.length > 2); Preconditions.checkArgum...
java
public static List<String> extractTableSegmentTokens(String qualifiedName) { Preconditions.checkNotNull(qualifiedName); List<String> retVal = new LinkedList<>(); String[] tokens = qualifiedName.split("[/]"); Preconditions.checkArgument(tokens.length > 2); Preconditions.checkArgum...
[ "public", "static", "List", "<", "String", ">", "extractTableSegmentTokens", "(", "String", "qualifiedName", ")", "{", "Preconditions", ".", "checkNotNull", "(", "qualifiedName", ")", ";", "List", "<", "String", ">", "retVal", "=", "new", "LinkedList", "<>", "...
Method to extract tokens that were used to compose fully qualified table segment name using method getQualifiedTableName. The first token in the returned list corresponds to scope. Remainder tokens correspond to tokens used to compose tableName. @param qualifiedName fully qualified table name @return tokens capturing...
[ "Method", "to", "extract", "tokens", "that", "were", "used", "to", "compose", "fully", "qualified", "table", "segment", "name", "using", "method", "getQualifiedTableName", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L341-L354
131,999
pravega/pravega
shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java
StreamSegmentNameUtils.isTableSegment
public static boolean isTableSegment(String qualifiedName) { Preconditions.checkNotNull(qualifiedName); String[] tokens = qualifiedName.split("[/]"); Preconditions.checkArgument(tokens.length > 2); return tokens[1].equals(TABLES); }
java
public static boolean isTableSegment(String qualifiedName) { Preconditions.checkNotNull(qualifiedName); String[] tokens = qualifiedName.split("[/]"); Preconditions.checkArgument(tokens.length > 2); return tokens[1].equals(TABLES); }
[ "public", "static", "boolean", "isTableSegment", "(", "String", "qualifiedName", ")", "{", "Preconditions", ".", "checkNotNull", "(", "qualifiedName", ")", ";", "String", "[", "]", "tokens", "=", "qualifiedName", ".", "split", "(", "\"[/]\"", ")", ";", "Precon...
Method to check if given segment name is a table name generated using getQualifiedTableName. @param qualifiedName qualified table name @return true if the name is generated using getQualifiedTableName. False otherwise
[ "Method", "to", "check", "if", "given", "segment", "name", "is", "a", "table", "name", "generated", "using", "getQualifiedTableName", "." ]
6e24df7470669b3956a07018f52b2c6b3c2a3503
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L361-L367