id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
132,000 | pravega/pravega | common/src/main/java/io/pravega/common/util/SequencedItemList.java | SequencedItemList.add | public boolean add(T item) {
ListNode<T> node = new ListNode<>(item);
synchronized (this.lock) {
if (this.tail == null) {
// List is currently empty.
this.head = node;
} else {
if (item.getSequenceNumber() <= this.tail.item.getSeque... | java | public boolean add(T item) {
ListNode<T> node = new ListNode<>(item);
synchronized (this.lock) {
if (this.tail == null) {
// List is currently empty.
this.head = node;
} else {
if (item.getSequenceNumber() <= this.tail.item.getSeque... | [
"public",
"boolean",
"add",
"(",
"T",
"item",
")",
"{",
"ListNode",
"<",
"T",
">",
"node",
"=",
"new",
"ListNode",
"<>",
"(",
"item",
")",
";",
"synchronized",
"(",
"this",
".",
"lock",
")",
"{",
"if",
"(",
"this",
".",
"tail",
"==",
"null",
")",... | Adds a new item at the end of the list, but only if the given item has a Sequence Number higher than the last
element in the list.
@param item The item to append.
@return True if the item was added (meets sequencing criteria or list was empty), false otherwise. | [
"Adds",
"a",
"new",
"item",
"at",
"the",
"end",
"of",
"the",
"list",
"but",
"only",
"if",
"the",
"given",
"item",
"has",
"a",
"Sequence",
"Number",
"higher",
"than",
"the",
"last",
"element",
"in",
"the",
"list",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/SequencedItemList.java#L57-L76 |
132,001 | pravega/pravega | common/src/main/java/io/pravega/common/util/SequencedItemList.java | SequencedItemList.truncate | public int truncate(long upToSequenceNumber) {
int count = 0;
synchronized (this.lock) {
// We truncate by finding the new head and simply pointing our head reference to it, as well as disconnecting
// its predecessor node from it. We also need to mark every truncated node as suc... | java | public int truncate(long upToSequenceNumber) {
int count = 0;
synchronized (this.lock) {
// We truncate by finding the new head and simply pointing our head reference to it, as well as disconnecting
// its predecessor node from it. We also need to mark every truncated node as suc... | [
"public",
"int",
"truncate",
"(",
"long",
"upToSequenceNumber",
")",
"{",
"int",
"count",
"=",
"0",
";",
"synchronized",
"(",
"this",
".",
"lock",
")",
"{",
"// We truncate by finding the new head and simply pointing our head reference to it, as well as disconnecting",
"// ... | Truncates items from the beginning of the list up to, and including, the element with the given Sequence Number.
@param upToSequenceNumber The Sequence Number to truncate up to.
@return The number of truncated items. | [
"Truncates",
"items",
"from",
"the",
"beginning",
"of",
"the",
"list",
"up",
"to",
"and",
"including",
"the",
"element",
"with",
"the",
"given",
"Sequence",
"Number",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/SequencedItemList.java#L84-L101 |
132,002 | pravega/pravega | common/src/main/java/io/pravega/common/util/SequencedItemList.java | SequencedItemList.read | public Iterator<T> read(long afterSequenceNumber, int count) {
ListNode<T> firstNode;
synchronized (this.lock) {
firstNode = this.head;
}
// Find the first node that has a Sequence Number after the given one, but make sure we release and reacquire
// the lock with ev... | java | public Iterator<T> read(long afterSequenceNumber, int count) {
ListNode<T> firstNode;
synchronized (this.lock) {
firstNode = this.head;
}
// Find the first node that has a Sequence Number after the given one, but make sure we release and reacquire
// the lock with ev... | [
"public",
"Iterator",
"<",
"T",
">",
"read",
"(",
"long",
"afterSequenceNumber",
",",
"int",
"count",
")",
"{",
"ListNode",
"<",
"T",
">",
"firstNode",
";",
"synchronized",
"(",
"this",
".",
"lock",
")",
"{",
"firstNode",
"=",
"this",
".",
"head",
";",... | Reads a number of items starting with the first one that has a Sequence Number higher than the given one.
@param afterSequenceNumber The sequence to search from.
@param count The maximum number of items to read.
@return An Iterator with the resulting items. If no results are available for the given param... | [
"Reads",
"a",
"number",
"of",
"items",
"starting",
"with",
"the",
"first",
"one",
"that",
"has",
"a",
"Sequence",
"Number",
"higher",
"than",
"the",
"given",
"one",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/SequencedItemList.java#L135-L150 |
132,003 | pravega/pravega | segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/PravegaRequestProcessor.java | PravegaRequestProcessor.handleReadResult | private void handleReadResult(ReadSegment request, ReadResult result) {
String segment = request.getSegment();
ArrayList<ReadResultEntryContents> cachedEntries = new ArrayList<>();
ReadResultEntry nonCachedEntry = collectCachedEntries(request.getOffset(), result, cachedEntries);
final St... | java | private void handleReadResult(ReadSegment request, ReadResult result) {
String segment = request.getSegment();
ArrayList<ReadResultEntryContents> cachedEntries = new ArrayList<>();
ReadResultEntry nonCachedEntry = collectCachedEntries(request.getOffset(), result, cachedEntries);
final St... | [
"private",
"void",
"handleReadResult",
"(",
"ReadSegment",
"request",
",",
"ReadResult",
"result",
")",
"{",
"String",
"segment",
"=",
"request",
".",
"getSegment",
"(",
")",
";",
"ArrayList",
"<",
"ReadResultEntryContents",
">",
"cachedEntries",
"=",
"new",
"Ar... | Handles a readResult.
If there are cached entries that can be returned without blocking only these are returned.
Otherwise the call will request the data and setup a callback to return the data when it is available.
If no data is available but it was detected that the Segment had been truncated beyond the current offse... | [
"Handles",
"a",
"readResult",
".",
"If",
"there",
"are",
"cached",
"entries",
"that",
"can",
"be",
"returned",
"without",
"blocking",
"only",
"these",
"are",
"returned",
".",
"Otherwise",
"the",
"call",
"will",
"request",
"the",
"data",
"and",
"setup",
"a",
... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/PravegaRequestProcessor.java#L222-L276 |
132,004 | pravega/pravega | segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/PravegaRequestProcessor.java | PravegaRequestProcessor.collectCachedEntries | private ReadResultEntry collectCachedEntries(long initialOffset, ReadResult readResult,
ArrayList<ReadResultEntryContents> cachedEntries) {
long expectedOffset = initialOffset;
while (readResult.hasNext()) {
ReadResultEntry entry = readResult.... | java | private ReadResultEntry collectCachedEntries(long initialOffset, ReadResult readResult,
ArrayList<ReadResultEntryContents> cachedEntries) {
long expectedOffset = initialOffset;
while (readResult.hasNext()) {
ReadResultEntry entry = readResult.... | [
"private",
"ReadResultEntry",
"collectCachedEntries",
"(",
"long",
"initialOffset",
",",
"ReadResult",
"readResult",
",",
"ArrayList",
"<",
"ReadResultEntryContents",
">",
"cachedEntries",
")",
"{",
"long",
"expectedOffset",
"=",
"initialOffset",
";",
"while",
"(",
"r... | Reads all of the cachedEntries from the ReadResult and puts their content into the cachedEntries list.
Upon encountering a non-cached entry, it stops iterating and returns it. | [
"Reads",
"all",
"of",
"the",
"cachedEntries",
"from",
"the",
"ReadResult",
"and",
"puts",
"their",
"content",
"into",
"the",
"cachedEntries",
"list",
".",
"Upon",
"encountering",
"a",
"non",
"-",
"cached",
"entry",
"it",
"stops",
"iterating",
"and",
"returns",... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/PravegaRequestProcessor.java#L296-L312 |
132,005 | pravega/pravega | segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/PravegaRequestProcessor.java | PravegaRequestProcessor.copyData | @SneakyThrows(IOException.class)
private ByteBuffer copyData(List<ReadResultEntryContents> contents) {
int totalSize = contents.stream().mapToInt(ReadResultEntryContents::getLength).sum();
ByteBuffer data = ByteBuffer.allocate(totalSize);
int bytesCopied = 0;
for (ReadResultEntryCon... | java | @SneakyThrows(IOException.class)
private ByteBuffer copyData(List<ReadResultEntryContents> contents) {
int totalSize = contents.stream().mapToInt(ReadResultEntryContents::getLength).sum();
ByteBuffer data = ByteBuffer.allocate(totalSize);
int bytesCopied = 0;
for (ReadResultEntryCon... | [
"@",
"SneakyThrows",
"(",
"IOException",
".",
"class",
")",
"private",
"ByteBuffer",
"copyData",
"(",
"List",
"<",
"ReadResultEntryContents",
">",
"contents",
")",
"{",
"int",
"totalSize",
"=",
"contents",
".",
"stream",
"(",
")",
".",
"mapToInt",
"(",
"Read... | Copy all of the contents provided into a byteBuffer and return it. | [
"Copy",
"all",
"of",
"the",
"contents",
"provided",
"into",
"a",
"byteBuffer",
"and",
"return",
"it",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/handler/PravegaRequestProcessor.java#L317-L329 |
132,006 | pravega/pravega | segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/ServiceStarter.java | ServiceStarter.start | public void start() throws Exception {
Exceptions.checkNotClosed(this.closed, this);
log.info("Initializing metrics provider ...");
MetricsProvider.initialize(builderConfig.getConfig(MetricsConfig::builder));
statsProvider = MetricsProvider.getMetricsProvider();
statsProvider.st... | java | public void start() throws Exception {
Exceptions.checkNotClosed(this.closed, this);
log.info("Initializing metrics provider ...");
MetricsProvider.initialize(builderConfig.getConfig(MetricsConfig::builder));
statsProvider = MetricsProvider.getMetricsProvider();
statsProvider.st... | [
"public",
"void",
"start",
"(",
")",
"throws",
"Exception",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
",",
"this",
")",
";",
"log",
".",
"info",
"(",
"\"Initializing metrics provider ...\"",
")",
";",
"MetricsProvider",
".",
"initia... | region Service Operation | [
"region",
"Service",
"Operation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/host/src/main/java/io/pravega/segmentstore/server/host/ServiceStarter.java#L83-L121 |
132,007 | pravega/pravega | common/src/main/java/io/pravega/common/util/ReusableLatch.java | ReusableLatch.await | public void await(long timeoutMillis) throws InterruptedException, TimeoutException {
if (released.get()) {
return;
}
if (!impl.tryAcquire(timeoutMillis, TimeUnit.MILLISECONDS)) {
throw new TimeoutException("Timeout expired prior to latch becoming available.");
}... | java | public void await(long timeoutMillis) throws InterruptedException, TimeoutException {
if (released.get()) {
return;
}
if (!impl.tryAcquire(timeoutMillis, TimeUnit.MILLISECONDS)) {
throw new TimeoutException("Timeout expired prior to latch becoming available.");
}... | [
"public",
"void",
"await",
"(",
"long",
"timeoutMillis",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
"{",
"if",
"(",
"released",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"impl",
".",
"tryAcquire",
"(",
"time... | Block until another thread calls release, or the thread is interrupted.
@param timeoutMillis Timeout, in milliseconds, to wait for the release.
@throws InterruptedException If the operation was interrupted while waiting.
@throws TimeoutException If the timeout expired prior to being able to await the release. | [
"Block",
"until",
"another",
"thread",
"calls",
"release",
"or",
"the",
"thread",
"is",
"interrupted",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ReusableLatch.java#L60-L68 |
132,008 | pravega/pravega | common/src/main/java/io/pravega/common/util/ReusableLatch.java | ReusableLatch.release | public void release() {
if (released.compareAndSet(false, true)) {
synchronized (releasingLock) {
if (released.get()) {
impl.release(Integer.MAX_VALUE);
}
}
}
} | java | public void release() {
if (released.compareAndSet(false, true)) {
synchronized (releasingLock) {
if (released.get()) {
impl.release(Integer.MAX_VALUE);
}
}
}
} | [
"public",
"void",
"release",
"(",
")",
"{",
"if",
"(",
"released",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"synchronized",
"(",
"releasingLock",
")",
"{",
"if",
"(",
"released",
".",
"get",
"(",
")",
")",
"{",
"impl",
".",
"... | Allow all waiting threads to go through, and all future threads to proceed without blocking. | [
"Allow",
"all",
"waiting",
"threads",
"to",
"go",
"through",
"and",
"all",
"future",
"threads",
"to",
"proceed",
"without",
"blocking",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ReusableLatch.java#L83-L91 |
132,009 | pravega/pravega | common/src/main/java/io/pravega/common/util/ReusableLatch.java | ReusableLatch.reset | public void reset() {
if (released.compareAndSet(true, false)) {
synchronized (releasingLock) {
if (!released.get()) {
impl.drainPermits();
}
}
}
} | java | public void reset() {
if (released.compareAndSet(true, false)) {
synchronized (releasingLock) {
if (!released.get()) {
impl.drainPermits();
}
}
}
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"if",
"(",
"released",
".",
"compareAndSet",
"(",
"true",
",",
"false",
")",
")",
"{",
"synchronized",
"(",
"releasingLock",
")",
"{",
"if",
"(",
"!",
"released",
".",
"get",
"(",
")",
")",
"{",
"impl",
"."... | Resets the latch to an un-release state. | [
"Resets",
"the",
"latch",
"to",
"an",
"un",
"-",
"release",
"state",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ReusableLatch.java#L105-L113 |
132,010 | pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/mocks/InMemoryDurableDataLog.java | InMemoryDurableDataLog.close | @Override
public void close() {
if (!this.closed) {
try {
this.entries.releaseLock(this.clientId);
} catch (DataLogWriterNotPrimaryException ex) {
// Nothing. Just let it go.
}
this.closed = true;
}
} | java | @Override
public void close() {
if (!this.closed) {
try {
this.entries.releaseLock(this.clientId);
} catch (DataLogWriterNotPrimaryException ex) {
// Nothing. Just let it go.
}
this.closed = true;
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"closed",
")",
"{",
"try",
"{",
"this",
".",
"entries",
".",
"releaseLock",
"(",
"this",
".",
"clientId",
")",
";",
"}",
"catch",
"(",
"DataLogWriterNotPrimaryExcep... | region DurableDataLog Implementation | [
"region",
"DurableDataLog",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/mocks/InMemoryDurableDataLog.java#L74-L85 |
132,011 | pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/EventStreamReaderImpl.java | EventStreamReaderImpl.updateGroupStateIfNeeded | @GuardedBy("readers")
private String updateGroupStateIfNeeded() throws ReaderNotInReaderGroupException {
if (atCheckpoint != null) {
groupState.checkpoint(atCheckpoint, getPosition());
releaseSegmentsIfNeeded();
}
String checkpoint = groupState.getCheckpoint();
... | java | @GuardedBy("readers")
private String updateGroupStateIfNeeded() throws ReaderNotInReaderGroupException {
if (atCheckpoint != null) {
groupState.checkpoint(atCheckpoint, getPosition());
releaseSegmentsIfNeeded();
}
String checkpoint = groupState.getCheckpoint();
... | [
"@",
"GuardedBy",
"(",
"\"readers\"",
")",
"private",
"String",
"updateGroupStateIfNeeded",
"(",
")",
"throws",
"ReaderNotInReaderGroupException",
"{",
"if",
"(",
"atCheckpoint",
"!=",
"null",
")",
"{",
"groupState",
".",
"checkpoint",
"(",
"atCheckpoint",
",",
"g... | If the last call was a checkpoint updates the reader group state to indicate it has completed
and releases segments.
If a checkpoint is pending its identifier is returned. (The checkpoint will be considered
complete when this is invoked again.)
Otherwise it checks for any segments that need to be acquired.
Segments ... | [
"If",
"the",
"last",
"call",
"was",
"a",
"checkpoint",
"updates",
"the",
"reader",
"group",
"state",
"to",
"indicate",
"it",
"has",
"completed",
"and",
"releases",
"segments",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/EventStreamReaderImpl.java#L167-L194 |
132,012 | pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/EventStreamReaderImpl.java | EventStreamReaderImpl.releaseSegmentsIfNeeded | @GuardedBy("readers")
private void releaseSegmentsIfNeeded() throws ReaderNotInReaderGroupException {
releaseSealedSegments();
Segment segment = groupState.findSegmentToReleaseIfRequired();
if (segment != null) {
log.info("{} releasing segment {}", this, segment);
Eve... | java | @GuardedBy("readers")
private void releaseSegmentsIfNeeded() throws ReaderNotInReaderGroupException {
releaseSealedSegments();
Segment segment = groupState.findSegmentToReleaseIfRequired();
if (segment != null) {
log.info("{} releasing segment {}", this, segment);
Eve... | [
"@",
"GuardedBy",
"(",
"\"readers\"",
")",
"private",
"void",
"releaseSegmentsIfNeeded",
"(",
")",
"throws",
"ReaderNotInReaderGroupException",
"{",
"releaseSealedSegments",
"(",
")",
";",
"Segment",
"segment",
"=",
"groupState",
".",
"findSegmentToReleaseIfRequired",
"... | Releases segments. This must not be invoked except immediately after a checkpoint. | [
"Releases",
"segments",
".",
"This",
"must",
"not",
"be",
"invoked",
"except",
"immediately",
"after",
"a",
"checkpoint",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/EventStreamReaderImpl.java#L199-L213 |
132,013 | pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/EventStreamReaderImpl.java | EventStreamReaderImpl.releaseSealedSegments | private void releaseSealedSegments() throws ReaderNotInReaderGroupException {
for (Iterator<Segment> iterator = sealedSegments.iterator(); iterator.hasNext();) {
Segment oldSegment = iterator.next();
if (groupState.handleEndOfSegment(oldSegment)) {
iterator.remove();
... | java | private void releaseSealedSegments() throws ReaderNotInReaderGroupException {
for (Iterator<Segment> iterator = sealedSegments.iterator(); iterator.hasNext();) {
Segment oldSegment = iterator.next();
if (groupState.handleEndOfSegment(oldSegment)) {
iterator.remove();
... | [
"private",
"void",
"releaseSealedSegments",
"(",
")",
"throws",
"ReaderNotInReaderGroupException",
"{",
"for",
"(",
"Iterator",
"<",
"Segment",
">",
"iterator",
"=",
"sealedSegments",
".",
"iterator",
"(",
")",
";",
"iterator",
".",
"hasNext",
"(",
")",
";",
"... | Releases all sealed segments, unless there is a checkpoint pending for this reader. | [
"Releases",
"all",
"sealed",
"segments",
"unless",
"there",
"is",
"a",
"checkpoint",
"pending",
"for",
"this",
"reader",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/EventStreamReaderImpl.java#L218-L227 |
132,014 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java | PersistentStreamBase.getConfiguration | @Override
public CompletableFuture<StreamConfiguration> getConfiguration() {
return getConfigurationData(false).thenApply(x -> x.getObject().getStreamConfiguration());
} | java | @Override
public CompletableFuture<StreamConfiguration> getConfiguration() {
return getConfigurationData(false).thenApply(x -> x.getObject().getStreamConfiguration());
} | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"StreamConfiguration",
">",
"getConfiguration",
"(",
")",
"{",
"return",
"getConfigurationData",
"(",
"false",
")",
".",
"thenApply",
"(",
"x",
"->",
"x",
".",
"getObject",
"(",
")",
".",
"getStreamConfigurati... | Fetch configuration at configurationPath.
@return Future of stream configuration | [
"Fetch",
"configuration",
"at",
"configurationPath",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java#L280-L283 |
132,015 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java | PersistentStreamBase.getSegment | @Override
public CompletableFuture<StreamSegmentRecord> getSegment(final long segmentId) {
// extract epoch from segment id.
// fetch epoch record for the said epoch
// extract segment record from it.
int epoch = StreamSegmentNameUtils.getEpoch(segmentId);
return getEpochReco... | java | @Override
public CompletableFuture<StreamSegmentRecord> getSegment(final long segmentId) {
// extract epoch from segment id.
// fetch epoch record for the said epoch
// extract segment record from it.
int epoch = StreamSegmentNameUtils.getEpoch(segmentId);
return getEpochReco... | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"StreamSegmentRecord",
">",
"getSegment",
"(",
"final",
"long",
"segmentId",
")",
"{",
"// extract epoch from segment id.",
"// fetch epoch record for the said epoch",
"// extract segment record from it.",
"int",
"epoch",
"="... | Fetches Segment metadata from the epoch in which segment was created.
@param segmentId segment id.
@return : Future, which when complete contains segment object | [
"Fetches",
"Segment",
"metadata",
"from",
"the",
"epoch",
"in",
"which",
"segment",
"was",
"created",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java#L331-L345 |
132,016 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java | PersistentStreamBase.findSegmentSplitsMerges | private long findSegmentSplitsMerges(List<StreamSegmentRecord> referenceSegmentsList, List<StreamSegmentRecord> targetSegmentsList) {
return referenceSegmentsList.stream().filter(
segment -> targetSegmentsList.stream().filter(target -> target.overlaps(segment)).count() > 1 ).count();
} | java | private long findSegmentSplitsMerges(List<StreamSegmentRecord> referenceSegmentsList, List<StreamSegmentRecord> targetSegmentsList) {
return referenceSegmentsList.stream().filter(
segment -> targetSegmentsList.stream().filter(target -> target.overlaps(segment)).count() > 1 ).count();
} | [
"private",
"long",
"findSegmentSplitsMerges",
"(",
"List",
"<",
"StreamSegmentRecord",
">",
"referenceSegmentsList",
",",
"List",
"<",
"StreamSegmentRecord",
">",
"targetSegmentsList",
")",
"{",
"return",
"referenceSegmentsList",
".",
"stream",
"(",
")",
".",
"filter"... | Method to calculate number of splits and merges.
Principle to calculate the number of splits and merges:
1- An event has occurred if a reference range is present (overlaps) in at least two consecutive target ranges.
2- If the direction of the check in 1 is forward, then it is a split, otherwise it is a merge.
@param ... | [
"Method",
"to",
"calculate",
"number",
"of",
"splits",
"and",
"merges",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java#L391-L394 |
132,017 | pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java | PersistentStreamBase.submitScale | @Override
public CompletableFuture<VersionedMetadata<EpochTransitionRecord>> submitScale(final List<Long> segmentsToSeal,
final List<Map.Entry<Double, Double>> newRanges,
... | java | @Override
public CompletableFuture<VersionedMetadata<EpochTransitionRecord>> submitScale(final List<Long> segmentsToSeal,
final List<Map.Entry<Double, Double>> newRanges,
... | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"VersionedMetadata",
"<",
"EpochTransitionRecord",
">",
">",
"submitScale",
"(",
"final",
"List",
"<",
"Long",
">",
"segmentsToSeal",
",",
"final",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Doub... | This method attempts to start a new scale workflow. For this it first computes epoch transition and stores it in the metadastore.
This method can be called by manual scale or during the processing of auto-scale event. Which means there could be
concurrent calls to this method.
@param segmentsToSeal segments that will ... | [
"This",
"method",
"attempts",
"to",
"start",
"a",
"new",
"scale",
"workflow",
".",
"For",
"this",
"it",
"first",
"computes",
"epoch",
"transition",
"and",
"stores",
"it",
"in",
"the",
"metadastore",
".",
"This",
"method",
"can",
"be",
"called",
"by",
"manu... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/PersistentStreamBase.java#L680-L725 |
132,018 | pravega/pravega | controller/src/main/java/io/pravega/controller/server/rpc/grpc/v1/ControllerServiceImpl.java | ControllerServiceImpl.authenticateExecuteAndProcessResults | private <T> void authenticateExecuteAndProcessResults(Supplier<String> authenticator, Function<String, CompletableFuture<T>> call,
final StreamObserver<T> streamObserver, RequestTag requestTag) {
try {
String delegationToken;
dele... | java | private <T> void authenticateExecuteAndProcessResults(Supplier<String> authenticator, Function<String, CompletableFuture<T>> call,
final StreamObserver<T> streamObserver, RequestTag requestTag) {
try {
String delegationToken;
dele... | [
"private",
"<",
"T",
">",
"void",
"authenticateExecuteAndProcessResults",
"(",
"Supplier",
"<",
"String",
">",
"authenticator",
",",
"Function",
"<",
"String",
",",
"CompletableFuture",
"<",
"T",
">",
">",
"call",
",",
"final",
"StreamObserver",
"<",
"T",
">",... | Convert responses from CompletableFuture to gRPC's Observer pattern. | [
"Convert",
"responses",
"from",
"CompletableFuture",
"to",
"gRPC",
"s",
"Observer",
"pattern",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rpc/grpc/v1/ControllerServiceImpl.java#L436-L466 |
132,019 | pravega/pravega | client/src/main/java/io/pravega/client/segment/impl/Segment.java | Segment.fromScopedName | public static Segment fromScopedName(String qualifiedName) {
if (StreamSegmentNameUtils.isTransactionSegment(qualifiedName)) {
String originalSegmentName = StreamSegmentNameUtils.getParentStreamSegmentName(qualifiedName);
return fromScopedName(originalSegmentName);
} else {
... | java | public static Segment fromScopedName(String qualifiedName) {
if (StreamSegmentNameUtils.isTransactionSegment(qualifiedName)) {
String originalSegmentName = StreamSegmentNameUtils.getParentStreamSegmentName(qualifiedName);
return fromScopedName(originalSegmentName);
} else {
... | [
"public",
"static",
"Segment",
"fromScopedName",
"(",
"String",
"qualifiedName",
")",
"{",
"if",
"(",
"StreamSegmentNameUtils",
".",
"isTransactionSegment",
"(",
"qualifiedName",
")",
")",
"{",
"String",
"originalSegmentName",
"=",
"StreamSegmentNameUtils",
".",
"getP... | Parses fully scoped name, and creates the segment.
@param qualifiedName Fully scoped segment name
@return Segment name. | [
"Parses",
"fully",
"scoped",
"name",
"and",
"creates",
"the",
"segment",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/segment/impl/Segment.java#L69-L87 |
132,020 | pravega/pravega | common/src/main/java/io/pravega/common/util/ResourcePool.java | ResourcePool.getResource | public CompletableFuture<CloseableResource<T>> getResource() {
CompletableFuture<CloseableResource<T>> future;
boolean tryCreateNewResource = false;
synchronized (lock) {
T t = idleResources.poll();
if (t != null) {
// return the object from the queue
... | java | public CompletableFuture<CloseableResource<T>> getResource() {
CompletableFuture<CloseableResource<T>> future;
boolean tryCreateNewResource = false;
synchronized (lock) {
T t = idleResources.poll();
if (t != null) {
// return the object from the queue
... | [
"public",
"CompletableFuture",
"<",
"CloseableResource",
"<",
"T",
">",
">",
"getResource",
"(",
")",
"{",
"CompletableFuture",
"<",
"CloseableResource",
"<",
"T",
">>",
"future",
";",
"boolean",
"tryCreateNewResource",
"=",
"false",
";",
"synchronized",
"(",
"l... | Method to get a resource initialized with supplied arg.
This method attempts to find an existing available resource.
If not found, it submits a new waiting request for whenever a resource becomes available. A resource could become available
because such a resource was returned to the pool or a new resource was created.... | [
"Method",
"to",
"get",
"a",
"resource",
"initialized",
"with",
"supplied",
"arg",
".",
"This",
"method",
"attempts",
"to",
"find",
"an",
"existing",
"available",
"resource",
".",
"If",
"not",
"found",
"it",
"submits",
"a",
"new",
"waiting",
"request",
"for",... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ResourcePool.java#L90-L111 |
132,021 | pravega/pravega | common/src/main/java/io/pravega/common/util/ResourcePool.java | ResourcePool.returnResource | private void returnResource(T t, boolean isValid) {
if (!isValid) {
handleInvalid(t);
} else {
WaitingRequest<T> waiting;
boolean toDestroy = false;
synchronized (lock) {
waiting = waitQueue.poll();
if (waiting == null) {
... | java | private void returnResource(T t, boolean isValid) {
if (!isValid) {
handleInvalid(t);
} else {
WaitingRequest<T> waiting;
boolean toDestroy = false;
synchronized (lock) {
waiting = waitQueue.poll();
if (waiting == null) {
... | [
"private",
"void",
"returnResource",
"(",
"T",
"t",
",",
"boolean",
"isValid",
")",
"{",
"if",
"(",
"!",
"isValid",
")",
"{",
"handleInvalid",
"(",
"t",
")",
";",
"}",
"else",
"{",
"WaitingRequest",
"<",
"T",
">",
"waiting",
";",
"boolean",
"toDestroy"... | Method to return resource back to the pool. Callers are expected to call close on the closableResource which in turn
calls the return resource method to return the resource to the pool so that it can be reused.
@param t resource to be returned
@param isValid is resource valid | [
"Method",
"to",
"return",
"resource",
"back",
"to",
"the",
"pool",
".",
"Callers",
"are",
"expected",
"to",
"call",
"close",
"on",
"the",
"closableResource",
"which",
"in",
"turn",
"calls",
"the",
"return",
"resource",
"method",
"to",
"return",
"the",
"resou... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ResourcePool.java#L120-L157 |
132,022 | pravega/pravega | common/src/main/java/io/pravega/common/util/ResourcePool.java | ResourcePool.shutdown | public void shutdown() {
// as resources are returned we need to shut them down
T t;
synchronized (lock) {
isRunning = false;
t = idleResources.poll();
}
while (t != null) {
returnResource(t, true);
synchronized (lock) {
... | java | public void shutdown() {
// as resources are returned we need to shut them down
T t;
synchronized (lock) {
isRunning = false;
t = idleResources.poll();
}
while (t != null) {
returnResource(t, true);
synchronized (lock) {
... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"// as resources are returned we need to shut them down",
"T",
"t",
";",
"synchronized",
"(",
"lock",
")",
"{",
"isRunning",
"=",
"false",
";",
"t",
"=",
"idleResources",
".",
"poll",
"(",
")",
";",
"}",
"while",
... | Shutdown the resource manager where all returned resources are closed and not put back into the
idle queue of resources.
It is important to note that even after shutdown is initiated, if `getresource` is invoked, it will return a resource. | [
"Shutdown",
"the",
"resource",
"manager",
"where",
"all",
"returned",
"resources",
"are",
"closed",
"and",
"not",
"put",
"back",
"into",
"the",
"idle",
"queue",
"of",
"resources",
".",
"It",
"is",
"important",
"to",
"note",
"that",
"even",
"after",
"shutdown... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ResourcePool.java#L249-L262 |
132,023 | pravega/pravega | bindings/src/main/java/io/pravega/storage/filesystem/FileSystemStorage.java | FileSystemStorage.execute | private <R> R execute(String segmentName, Callable<R> operation) throws StreamSegmentException {
Exceptions.checkNotClosed(this.closed.get(), this);
try {
return operation.call();
} catch (Exception e) {
return throwException(segmentName, e);
}
} | java | private <R> R execute(String segmentName, Callable<R> operation) throws StreamSegmentException {
Exceptions.checkNotClosed(this.closed.get(), this);
try {
return operation.call();
} catch (Exception e) {
return throwException(segmentName, e);
}
} | [
"private",
"<",
"R",
">",
"R",
"execute",
"(",
"String",
"segmentName",
",",
"Callable",
"<",
"R",
">",
"operation",
")",
"throws",
"StreamSegmentException",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
".",
"get",
"(",
")",
",",
... | Executes the given Callable and returns its result, while translating any Exceptions bubbling out of it into
StreamSegmentExceptions.
@param segmentName Full name of the StreamSegment.
@param operation The function to execute.
@param <R> Return type of the operation.
@return Instance of the return type... | [
"Executes",
"the",
"given",
"Callable",
"and",
"returns",
"its",
"result",
"while",
"translating",
"any",
"Exceptions",
"bubbling",
"out",
"of",
"it",
"into",
"StreamSegmentExceptions",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/filesystem/FileSystemStorage.java#L402-L409 |
132,024 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/CacheManager.java | CacheManager.register | public void register(Client client) {
Exceptions.checkNotClosed(this.closed.get(), this);
Preconditions.checkNotNull(client, "client");
synchronized (this.clients) {
if (!this.clients.contains(client)) {
this.clients.add(client);
client.updateGeneratio... | java | public void register(Client client) {
Exceptions.checkNotClosed(this.closed.get(), this);
Preconditions.checkNotNull(client, "client");
synchronized (this.clients) {
if (!this.clients.contains(client)) {
this.clients.add(client);
client.updateGeneratio... | [
"public",
"void",
"register",
"(",
"Client",
"client",
")",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
".",
"get",
"(",
")",
",",
"this",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"client",
",",
"\"client\"",
")",
";... | Registers the given client to this CacheManager.
@param client The client to register. | [
"Registers",
"the",
"given",
"client",
"to",
"this",
"CacheManager",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/CacheManager.java#L156-L167 |
132,025 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/CacheManager.java | CacheManager.unregister | public void unregister(Client client) {
if (this.closed.get()) {
// We are done. Nothing to do here.
return;
}
Preconditions.checkNotNull(client, "client");
synchronized (this.clients) {
this.clients.remove(client);
}
log.info("{} Unr... | java | public void unregister(Client client) {
if (this.closed.get()) {
// We are done. Nothing to do here.
return;
}
Preconditions.checkNotNull(client, "client");
synchronized (this.clients) {
this.clients.remove(client);
}
log.info("{} Unr... | [
"public",
"void",
"unregister",
"(",
"Client",
"client",
")",
"{",
"if",
"(",
"this",
".",
"closed",
".",
"get",
"(",
")",
")",
"{",
"// We are done. Nothing to do here.",
"return",
";",
"}",
"Preconditions",
".",
"checkNotNull",
"(",
"client",
",",
"\"clien... | Unregisters the given client from this CacheManager.
@param client The client to unregister. | [
"Unregisters",
"the",
"given",
"client",
"from",
"this",
"CacheManager",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/CacheManager.java#L174-L186 |
132,026 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DataFrameOutputStream.java | DataFrameOutputStream.write | @Override
public void write(int b) throws IOException {
Exceptions.checkNotClosed(this.closed, this);
Preconditions.checkState(this.currentFrame != null, "No current frame exists. Most likely no record is started.");
int attemptCount = 0;
int totalBytesWritten = 0;
while (to... | java | @Override
public void write(int b) throws IOException {
Exceptions.checkNotClosed(this.closed, this);
Preconditions.checkState(this.currentFrame != null, "No current frame exists. Most likely no record is started.");
int attemptCount = 0;
int totalBytesWritten = 0;
while (to... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"int",
"b",
")",
"throws",
"IOException",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
",",
"this",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"this",
".",
"currentFrame",
"!... | region OutputStream Implementation | [
"region",
"OutputStream",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DataFrameOutputStream.java#L65-L88 |
132,027 | pravega/pravega | common/src/main/java/io/pravega/common/util/ByteArraySegment.java | ByteArraySegment.get | @Override
public byte get(int index) {
Preconditions.checkElementIndex(index, this.length, "index");
return this.array[index + this.startOffset];
} | java | @Override
public byte get(int index) {
Preconditions.checkElementIndex(index, this.length, "index");
return this.array[index + this.startOffset];
} | [
"@",
"Override",
"public",
"byte",
"get",
"(",
"int",
"index",
")",
"{",
"Preconditions",
".",
"checkElementIndex",
"(",
"index",
",",
"this",
".",
"length",
",",
"\"index\"",
")",
";",
"return",
"this",
".",
"array",
"[",
"index",
"+",
"this",
".",
"s... | region ArrayView Implementation | [
"region",
"ArrayView",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ByteArraySegment.java#L97-L101 |
132,028 | pravega/pravega | common/src/main/java/io/pravega/common/util/ByteArraySegment.java | ByteArraySegment.set | public void set(int index, byte value) {
Preconditions.checkState(!this.readOnly, "Cannot modify a read-only ByteArraySegment.");
Preconditions.checkElementIndex(index, this.length, "index");
this.array[index + this.startOffset] = value;
} | java | public void set(int index, byte value) {
Preconditions.checkState(!this.readOnly, "Cannot modify a read-only ByteArraySegment.");
Preconditions.checkElementIndex(index, this.length, "index");
this.array[index + this.startOffset] = value;
} | [
"public",
"void",
"set",
"(",
"int",
"index",
",",
"byte",
"value",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"this",
".",
"readOnly",
",",
"\"Cannot modify a read-only ByteArraySegment.\"",
")",
";",
"Preconditions",
".",
"checkElementIndex",
"(",
... | Sets the value at the specified index.
@param index The index to set the value at.
@param value The value to set.
@throws IllegalStateException If the ByteArraySegment is readonly.
@throws ArrayIndexOutOfBoundsException If index is invalid. | [
"Sets",
"the",
"value",
"at",
"the",
"specified",
"index",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ByteArraySegment.java#L156-L160 |
132,029 | pravega/pravega | common/src/main/java/io/pravega/common/util/ByteArraySegment.java | ByteArraySegment.copyFrom | public void copyFrom(ByteArraySegment source, int targetOffset, int length) {
Preconditions.checkState(!this.readOnly, "Cannot modify a read-only ByteArraySegment.");
Exceptions.checkArrayRange(targetOffset, length, this.length, "index", "values.length");
Preconditions.checkElementIndex(length, ... | java | public void copyFrom(ByteArraySegment source, int targetOffset, int length) {
Preconditions.checkState(!this.readOnly, "Cannot modify a read-only ByteArraySegment.");
Exceptions.checkArrayRange(targetOffset, length, this.length, "index", "values.length");
Preconditions.checkElementIndex(length, ... | [
"public",
"void",
"copyFrom",
"(",
"ByteArraySegment",
"source",
",",
"int",
"targetOffset",
",",
"int",
"length",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"this",
".",
"readOnly",
",",
"\"Cannot modify a read-only ByteArraySegment.\"",
")",
";",
"E... | Copies a specified number of bytes from the given ByteArraySegment into this ByteArraySegment.
@param source The ByteArraySegment to copy bytes from.
@param targetOffset The offset within this ByteArraySegment to start copying at.
@param length The number of bytes to copy.
@throws IllegalStateException ... | [
"Copies",
"a",
"specified",
"number",
"of",
"bytes",
"from",
"the",
"given",
"ByteArraySegment",
"into",
"this",
"ByteArraySegment",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ByteArraySegment.java#L180-L186 |
132,030 | pravega/pravega | common/src/main/java/io/pravega/common/util/ByteArraySegment.java | ByteArraySegment.subSegment | public ByteArraySegment subSegment(int offset, int length, boolean readOnly) {
Exceptions.checkArrayRange(offset, length, this.length, "offset", "length");
return new ByteArraySegment(this.array, this.startOffset + offset, length, readOnly || this.readOnly);
} | java | public ByteArraySegment subSegment(int offset, int length, boolean readOnly) {
Exceptions.checkArrayRange(offset, length, this.length, "offset", "length");
return new ByteArraySegment(this.array, this.startOffset + offset, length, readOnly || this.readOnly);
} | [
"public",
"ByteArraySegment",
"subSegment",
"(",
"int",
"offset",
",",
"int",
"length",
",",
"boolean",
"readOnly",
")",
"{",
"Exceptions",
".",
"checkArrayRange",
"(",
"offset",
",",
"length",
",",
"this",
".",
"length",
",",
"\"offset\"",
",",
"\"length\"",
... | Returns a new ByteArraySegment that is a sub-segment of this ByteArraySegment. The new ByteArraySegment wraps
the same underlying byte array that this ByteArraySegment does.
@param offset The offset within this ByteArraySegment where the new ByteArraySegment starts.
@param length The length of the new ByteArraySeg... | [
"Returns",
"a",
"new",
"ByteArraySegment",
"that",
"is",
"a",
"sub",
"-",
"segment",
"of",
"this",
"ByteArraySegment",
".",
"The",
"new",
"ByteArraySegment",
"wraps",
"the",
"same",
"underlying",
"byte",
"array",
"that",
"this",
"ByteArraySegment",
"does",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ByteArraySegment.java#L270-L273 |
132,031 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DataFrameBuilder.java | DataFrameBuilder.append | void append(T logItem) throws IOException {
Exceptions.checkNotClosed(this.closed.get(), this);
long seqNo = logItem.getSequenceNumber();
Exceptions.checkArgument(this.lastSerializedSequenceNumber < seqNo, "logItem",
"Invalid sequence number. Expected: greater than %d, given: %d.... | java | void append(T logItem) throws IOException {
Exceptions.checkNotClosed(this.closed.get(), this);
long seqNo = logItem.getSequenceNumber();
Exceptions.checkArgument(this.lastSerializedSequenceNumber < seqNo, "logItem",
"Invalid sequence number. Expected: greater than %d, given: %d.... | [
"void",
"append",
"(",
"T",
"logItem",
")",
"throws",
"IOException",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
".",
"get",
"(",
")",
",",
"this",
")",
";",
"long",
"seqNo",
"=",
"logItem",
".",
"getSequenceNumber",
"(",
")",
... | Appends a LogItem to the DataFrameBuilder. If any exceptions happened during serialization, whatever contents was
written to the DataFrame will be discarded. Note that if a LogItem spans multiple DataFrames, in case of failure,
the content serialized to already committed DataFrames will not be discarded. That case will... | [
"Appends",
"a",
"LogItem",
"to",
"the",
"DataFrameBuilder",
".",
"If",
"any",
"exceptions",
"happened",
"during",
"serialization",
"whatever",
"contents",
"was",
"written",
"to",
"the",
"DataFrame",
"will",
"be",
"discarded",
".",
"Note",
"that",
"if",
"a",
"L... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/DataFrameBuilder.java#L129-L166 |
132,032 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.initializeStreamWriters | @Synchronized
public void initializeStreamWriters(final EventStreamClientFactory clientFactory,
final ControllerEventProcessorConfig config) {
if (!commitWriterFuture.isDone()) {
commitWriterFuture.complete(clientFactory.createEventWriter(
... | java | @Synchronized
public void initializeStreamWriters(final EventStreamClientFactory clientFactory,
final ControllerEventProcessorConfig config) {
if (!commitWriterFuture.isDone()) {
commitWriterFuture.complete(clientFactory.createEventWriter(
... | [
"@",
"Synchronized",
"public",
"void",
"initializeStreamWriters",
"(",
"final",
"EventStreamClientFactory",
"clientFactory",
",",
"final",
"ControllerEventProcessorConfig",
"config",
")",
"{",
"if",
"(",
"!",
"commitWriterFuture",
".",
"isDone",
"(",
")",
")",
"{",
... | Initializes stream writers for commit and abort streams.
This method should be called immediately after creating StreamTransactionMetadataTasks object.
@param clientFactory Client factory reference.
@param config Controller event processor configuration. | [
"Initializes",
"stream",
"writers",
"for",
"commit",
"and",
"abort",
"streams",
".",
"This",
"method",
"should",
"be",
"called",
"immediately",
"after",
"creating",
"StreamTransactionMetadataTasks",
"object",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L157-L173 |
132,033 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.createTxn | public CompletableFuture<Pair<VersionedTransactionData, List<StreamSegmentRecord>>> createTxn(final String scope,
final String stream,
final long le... | java | public CompletableFuture<Pair<VersionedTransactionData, List<StreamSegmentRecord>>> createTxn(final String scope,
final String stream,
final long le... | [
"public",
"CompletableFuture",
"<",
"Pair",
"<",
"VersionedTransactionData",
",",
"List",
"<",
"StreamSegmentRecord",
">",
">",
">",
"createTxn",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"long",
"lease",
",",
"final",
"O... | Create transaction.
@param scope stream scope.
@param stream stream name.
@param lease Time for which transaction shall remain open with sending any heartbeat.
the scaling operation is initiated on the txn stream.
@param contextOpt operational context
@return transaction i... | [
"Create",
"transaction",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L194-L200 |
132,034 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.pingTxn | public CompletableFuture<PingTxnStatus> pingTxn(final String scope,
final String stream,
final UUID txId,
final long lease,
... | java | public CompletableFuture<PingTxnStatus> pingTxn(final String scope,
final String stream,
final UUID txId,
final long lease,
... | [
"public",
"CompletableFuture",
"<",
"PingTxnStatus",
">",
"pingTxn",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"UUID",
"txId",
",",
"final",
"long",
"lease",
",",
"final",
"OperationContext",
"contextOpt",
")",
"{",
"fina... | Transaction heartbeat, that increases transaction timeout by lease number of milliseconds.
@param scope Stream scope.
@param stream Stream name.
@param txId Transaction identifier.
@param lease Amount of time in milliseconds by which to extend the transaction lease.
@param contextOpt operational context
@return ... | [
"Transaction",
"heartbeat",
"that",
"increases",
"transaction",
"timeout",
"by",
"lease",
"number",
"of",
"milliseconds",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L212-L219 |
132,035 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.abortTxn | public CompletableFuture<TxnStatus> abortTxn(final String scope,
final String stream,
final UUID txId,
final Version version,
... | java | public CompletableFuture<TxnStatus> abortTxn(final String scope,
final String stream,
final UUID txId,
final Version version,
... | [
"public",
"CompletableFuture",
"<",
"TxnStatus",
">",
"abortTxn",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"UUID",
"txId",
",",
"final",
"Version",
"version",
",",
"final",
"OperationContext",
"contextOpt",
")",
"{",
"fi... | Abort transaction.
@param scope stream scope.
@param stream stream name.
@param txId transaction id.
@param version Expected version of the transaction record in the store.
@param contextOpt operational context
@return true/false. | [
"Abort",
"transaction",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L231-L239 |
132,036 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.commitTxn | public CompletableFuture<TxnStatus> commitTxn(final String scope, final String stream, final UUID txId,
final OperationContext contextOpt) {
final OperationContext context = getNonNullOperationContext(scope, stream, contextOpt);
return withRetriesAsync((... | java | public CompletableFuture<TxnStatus> commitTxn(final String scope, final String stream, final UUID txId,
final OperationContext contextOpt) {
final OperationContext context = getNonNullOperationContext(scope, stream, contextOpt);
return withRetriesAsync((... | [
"public",
"CompletableFuture",
"<",
"TxnStatus",
">",
"commitTxn",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"UUID",
"txId",
",",
"final",
"OperationContext",
"contextOpt",
")",
"{",
"final",
"OperationContext",
"context",
... | Commit transaction.
@param scope stream scope.
@param stream stream name.
@param txId transaction id.
@param contextOpt optional context
@return true/false. | [
"Commit",
"transaction",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L250-L255 |
132,037 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.createTxnBody | CompletableFuture<Pair<VersionedTransactionData, List<StreamSegmentRecord>>> createTxnBody(final String scope,
final String stream,
final long lease,
... | java | CompletableFuture<Pair<VersionedTransactionData, List<StreamSegmentRecord>>> createTxnBody(final String scope,
final String stream,
final long lease,
... | [
"CompletableFuture",
"<",
"Pair",
"<",
"VersionedTransactionData",
",",
"List",
"<",
"StreamSegmentRecord",
">",
">",
">",
"createTxnBody",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"long",
"lease",
",",
"final",
"Operation... | Creates txn on the specified stream.
Post-condition:
1. If txn creation succeeds, then
(a) txn node is created in the store,
(b) txn segments are successfully created on respective segment stores,
(c) txn is present in the host-txn index of current host,
(d) txn's timeout is being tracked in timeout service.
2. If pr... | [
"Creates",
"txn",
"on",
"the",
"specified",
"stream",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L284-L339 |
132,038 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.pingTxnBody | CompletableFuture<PingTxnStatus> pingTxnBody(final String scope,
final String stream,
final UUID txnId,
final long lease,
fi... | java | CompletableFuture<PingTxnStatus> pingTxnBody(final String scope,
final String stream,
final UUID txnId,
final long lease,
fi... | [
"CompletableFuture",
"<",
"PingTxnStatus",
">",
"pingTxnBody",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"UUID",
"txnId",
",",
"final",
"long",
"lease",
",",
"final",
"OperationContext",
"ctx",
")",
"{",
"if",
"(",
"!",... | Ping a txn thereby updating its timeout to current time + lease.
Post-condition:
1. If ping request completes successfully, then
(a) txn timeout is set to lease + current time in timeout service,
(b) txn version in timeout service equals version of txn node in store,
(c) if txn's timeout was not previously tracked in ... | [
"Ping",
"a",
"txn",
"thereby",
"updating",
"its",
"timeout",
"to",
"current",
"time",
"+",
"lease",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L418-L429 |
132,039 | pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/RollingStorage.java | RollingStorage.rollover | private void rollover(RollingSegmentHandle handle) throws StreamSegmentException {
Preconditions.checkArgument(handle.getHeaderHandle() != null, "Cannot rollover a Segment with no header.");
Preconditions.checkArgument(!handle.isReadOnly(), "Cannot rollover using a read-only handle.");
Precondit... | java | private void rollover(RollingSegmentHandle handle) throws StreamSegmentException {
Preconditions.checkArgument(handle.getHeaderHandle() != null, "Cannot rollover a Segment with no header.");
Preconditions.checkArgument(!handle.isReadOnly(), "Cannot rollover using a read-only handle.");
Precondit... | [
"private",
"void",
"rollover",
"(",
"RollingSegmentHandle",
"handle",
")",
"throws",
"StreamSegmentException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"handle",
".",
"getHeaderHandle",
"(",
")",
"!=",
"null",
",",
"\"Cannot rollover a Segment with no header.\"",
... | region SegmentChunk Operations | [
"region",
"SegmentChunk",
"Operations"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/RollingStorage.java#L514-L536 |
132,040 | pravega/pravega | segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/RollingStorage.java | RollingStorage.createHeader | private void createHeader(RollingSegmentHandle handle) throws StreamSegmentException {
Preconditions.checkArgument(handle.getHeaderHandle() == null, "handle already has a header.");
// Create a new Header SegmentChunk.
String headerName = StreamSegmentNameUtils.getHeaderSegmentName(handle.getSe... | java | private void createHeader(RollingSegmentHandle handle) throws StreamSegmentException {
Preconditions.checkArgument(handle.getHeaderHandle() == null, "handle already has a header.");
// Create a new Header SegmentChunk.
String headerName = StreamSegmentNameUtils.getHeaderSegmentName(handle.getSe... | [
"private",
"void",
"createHeader",
"(",
"RollingSegmentHandle",
"handle",
")",
"throws",
"StreamSegmentException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"handle",
".",
"getHeaderHandle",
"(",
")",
"==",
"null",
",",
"\"handle already has a header.\"",
")",
... | region Header Operations | [
"region",
"Header",
"Operations"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/src/main/java/io/pravega/segmentstore/storage/rolling/RollingStorage.java#L633-L645 |
132,041 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java | StreamSegmentContainer.createWriterProcessors | private Collection<WriterSegmentProcessor> createWriterProcessors(UpdateableSegmentMetadata segmentMetadata) {
ImmutableList.Builder<WriterSegmentProcessor> builder = ImmutableList.builder();
this.extensions.values().forEach(p -> builder.addAll(p.createWriterSegmentProcessors(segmentMetadata)));
... | java | private Collection<WriterSegmentProcessor> createWriterProcessors(UpdateableSegmentMetadata segmentMetadata) {
ImmutableList.Builder<WriterSegmentProcessor> builder = ImmutableList.builder();
this.extensions.values().forEach(p -> builder.addAll(p.createWriterSegmentProcessors(segmentMetadata)));
... | [
"private",
"Collection",
"<",
"WriterSegmentProcessor",
">",
"createWriterProcessors",
"(",
"UpdateableSegmentMetadata",
"segmentMetadata",
")",
"{",
"ImmutableList",
".",
"Builder",
"<",
"WriterSegmentProcessor",
">",
"builder",
"=",
"ImmutableList",
".",
"builder",
"(",... | Creates WriterSegmentProcessors for the given Segment Metadata from all registered Extensions.
@param segmentMetadata The Segment Metadata to create WriterSegmentProcessors for.
@return A Collection of processors. | [
"Creates",
"WriterSegmentProcessors",
"for",
"the",
"given",
"Segment",
"Metadata",
"from",
"all",
"registered",
"Extensions",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java#L171-L175 |
132,042 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java | StreamSegmentContainer.doStop | private void doStop(Throwable cause) {
long traceId = LoggerHelpers.traceEnterWithContext(log, traceObjectId, "doStop");
log.info("{}: Stopping.", this.traceObjectId);
CompletableFuture.allOf(
Services.stopAsync(this.metadataCleaner, this.executor),
Services.stopA... | java | private void doStop(Throwable cause) {
long traceId = LoggerHelpers.traceEnterWithContext(log, traceObjectId, "doStop");
log.info("{}: Stopping.", this.traceObjectId);
CompletableFuture.allOf(
Services.stopAsync(this.metadataCleaner, this.executor),
Services.stopA... | [
"private",
"void",
"doStop",
"(",
"Throwable",
"cause",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"traceObjectId",
",",
"\"doStop\"",
")",
";",
"log",
".",
"info",
"(",
"\"{}: Stopping.\"",
",",
"this",
... | Stops the StreamSegmentContainer by stopping all components, waiting for them to stop, and reports a normal
shutdown or failure based on case. It will report a normal shutdown only if all components shut down normally
and cause is null. Otherwise, the container will report either the exception of the failed component, ... | [
"Stops",
"the",
"StreamSegmentContainer",
"by",
"stopping",
"all",
"components",
"waiting",
"for",
"them",
"to",
"stop",
"and",
"reports",
"a",
"normal",
"shutdown",
"or",
"failure",
"based",
"on",
"case",
".",
"It",
"will",
"report",
"a",
"normal",
"shutdown"... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java#L275-L306 |
132,043 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java | StreamSegmentContainer.getActiveSegments | @Override
public Collection<SegmentProperties> getActiveSegments() {
ensureRunning();
logRequest("getActiveSegments");
// To reduce locking in the metadata, we first get the list of Segment Ids, then we fetch their metadata
// one by one. This only locks the metadata on the first ca... | java | @Override
public Collection<SegmentProperties> getActiveSegments() {
ensureRunning();
logRequest("getActiveSegments");
// To reduce locking in the metadata, we first get the list of Segment Ids, then we fetch their metadata
// one by one. This only locks the metadata on the first ca... | [
"@",
"Override",
"public",
"Collection",
"<",
"SegmentProperties",
">",
"getActiveSegments",
"(",
")",
"{",
"ensureRunning",
"(",
")",
";",
"logRequest",
"(",
"\"getActiveSegments\"",
")",
";",
"// To reduce locking in the metadata, we first get the list of Segment Ids, then ... | region SegmentContainer Implementation | [
"region",
"SegmentContainer",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java#L551-L564 |
132,044 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java | StreamSegmentContainer.trySealStreamSegment | private CompletableFuture<Void> trySealStreamSegment(SegmentMetadata metadata, Duration timeout) {
if (metadata.isSealed()) {
return CompletableFuture.completedFuture(null);
} else {
// It is OK to ignore StreamSegmentSealedException as the segment may have already been sealed by... | java | private CompletableFuture<Void> trySealStreamSegment(SegmentMetadata metadata, Duration timeout) {
if (metadata.isSealed()) {
return CompletableFuture.completedFuture(null);
} else {
// It is OK to ignore StreamSegmentSealedException as the segment may have already been sealed by... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"trySealStreamSegment",
"(",
"SegmentMetadata",
"metadata",
",",
"Duration",
"timeout",
")",
"{",
"if",
"(",
"metadata",
".",
"isSealed",
"(",
")",
")",
"{",
"return",
"CompletableFuture",
".",
"completedFuture",
... | Attempts to seal a Segment that may already be sealed.
@param metadata The SegmentMetadata for the Segment to Seal.
@param timeout Timeout for the operation.
@return A CompletableFuture that will indicate when the operation completes. If the given segment is already sealed,
this future will already be completed, othe... | [
"Attempts",
"to",
"seal",
"a",
"Segment",
"that",
"may",
"already",
"be",
"sealed",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java#L611-L622 |
132,045 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java | StreamSegmentContainer.processAttributeUpdaterOperation | private <T extends Operation & AttributeUpdaterOperation> CompletableFuture<Void> processAttributeUpdaterOperation(T operation, TimeoutTimer timer) {
Collection<AttributeUpdate> updates = operation.getAttributeUpdates();
if (updates == null || updates.isEmpty()) {
// No need for extra compli... | java | private <T extends Operation & AttributeUpdaterOperation> CompletableFuture<Void> processAttributeUpdaterOperation(T operation, TimeoutTimer timer) {
Collection<AttributeUpdate> updates = operation.getAttributeUpdates();
if (updates == null || updates.isEmpty()) {
// No need for extra compli... | [
"private",
"<",
"T",
"extends",
"Operation",
"&",
"AttributeUpdaterOperation",
">",
"CompletableFuture",
"<",
"Void",
">",
"processAttributeUpdaterOperation",
"(",
"T",
"operation",
",",
"TimeoutTimer",
"timer",
")",
"{",
"Collection",
"<",
"AttributeUpdate",
">",
"... | Processes the given AttributeUpdateOperation with exactly one retry in case it was rejected because of an attribute
update failure due to the attribute value missing from the in-memory cache.
@param operation The Operation to process.
@param timer Timer for the operation.
@param <T> Type of the operation.
@r... | [
"Processes",
"the",
"given",
"AttributeUpdateOperation",
"with",
"exactly",
"one",
"retry",
"in",
"case",
"it",
"was",
"rejected",
"because",
"of",
"an",
"attribute",
"update",
"failure",
"due",
"to",
"the",
"attribute",
"value",
"missing",
"from",
"the",
"in",
... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/StreamSegmentContainer.java#L634-L666 |
132,046 | pravega/pravega | client/src/main/java/io/pravega/client/batch/impl/BatchClientFactoryImpl.java | BatchClientFactoryImpl.getStreamInfo | @Override
@Deprecated
public CompletableFuture<io.pravega.client.batch.StreamInfo> getStreamInfo(final Stream stream) {
Preconditions.checkNotNull(stream, "stream");
StreamManagerImpl streamManager = new StreamManagerImpl(this.controller, this.connectionFactory);
return streamManager.ge... | java | @Override
@Deprecated
public CompletableFuture<io.pravega.client.batch.StreamInfo> getStreamInfo(final Stream stream) {
Preconditions.checkNotNull(stream, "stream");
StreamManagerImpl streamManager = new StreamManagerImpl(this.controller, this.connectionFactory);
return streamManager.ge... | [
"@",
"Override",
"@",
"Deprecated",
"public",
"CompletableFuture",
"<",
"io",
".",
"pravega",
".",
"client",
".",
"batch",
".",
"StreamInfo",
">",
"getStreamInfo",
"(",
"final",
"Stream",
"stream",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"stream",... | Used to fetch the StreamInfo of a given stream. This should be removed in time.
@deprecated Use {@link io.pravega.client.admin.StreamManager#getStreamInfo(String, String)} to fetch StreamInfo. | [
"Used",
"to",
"fetch",
"the",
"StreamInfo",
"of",
"a",
"given",
"stream",
".",
"This",
"should",
"be",
"removed",
"in",
"time",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/batch/impl/BatchClientFactoryImpl.java#L75-L84 |
132,047 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/FutureReadResultEntryCollection.java | FutureReadResultEntryCollection.close | public List<FutureReadResultEntry> close() {
List<FutureReadResultEntry> result;
synchronized (this.reads) {
if (this.closed) {
result = Collections.emptyList();
} else {
result = new ArrayList<>(this.reads);
this.reads.clear();
... | java | public List<FutureReadResultEntry> close() {
List<FutureReadResultEntry> result;
synchronized (this.reads) {
if (this.closed) {
result = Collections.emptyList();
} else {
result = new ArrayList<>(this.reads);
this.reads.clear();
... | [
"public",
"List",
"<",
"FutureReadResultEntry",
">",
"close",
"(",
")",
"{",
"List",
"<",
"FutureReadResultEntry",
">",
"result",
";",
"synchronized",
"(",
"this",
".",
"reads",
")",
"{",
"if",
"(",
"this",
".",
"closed",
")",
"{",
"result",
"=",
"Collec... | Closes this instance of the FutureReadResultEntryCollection class.
@return A List containing all currently registered FutureReadResultEntries. | [
"Closes",
"this",
"instance",
"of",
"the",
"FutureReadResultEntryCollection",
"class",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/FutureReadResultEntryCollection.java#L52-L65 |
132,048 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/FutureReadResultEntryCollection.java | FutureReadResultEntryCollection.add | public void add(FutureReadResultEntry entry) {
synchronized (this.reads) {
Exceptions.checkNotClosed(this.closed, this);
this.reads.add(entry);
}
} | java | public void add(FutureReadResultEntry entry) {
synchronized (this.reads) {
Exceptions.checkNotClosed(this.closed, this);
this.reads.add(entry);
}
} | [
"public",
"void",
"add",
"(",
"FutureReadResultEntry",
"entry",
")",
"{",
"synchronized",
"(",
"this",
".",
"reads",
")",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
",",
"this",
")",
";",
"this",
".",
"reads",
".",
"add",
"(",
... | Adds a new Result Entry.
@param entry The entry to add. | [
"Adds",
"a",
"new",
"Result",
"Entry",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/FutureReadResultEntryCollection.java#L72-L77 |
132,049 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/FutureReadResultEntryCollection.java | FutureReadResultEntryCollection.poll | Collection<FutureReadResultEntry> poll(long maxOffset) {
List<FutureReadResultEntry> result = new ArrayList<>();
synchronized (this.reads) {
Exceptions.checkNotClosed(this.closed, this);
// 'reads' is sorted by Starting Offset, in ascending order. As long as it is not empty and ... | java | Collection<FutureReadResultEntry> poll(long maxOffset) {
List<FutureReadResultEntry> result = new ArrayList<>();
synchronized (this.reads) {
Exceptions.checkNotClosed(this.closed, this);
// 'reads' is sorted by Starting Offset, in ascending order. As long as it is not empty and ... | [
"Collection",
"<",
"FutureReadResultEntry",
">",
"poll",
"(",
"long",
"maxOffset",
")",
"{",
"List",
"<",
"FutureReadResultEntry",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"synchronized",
"(",
"this",
".",
"reads",
")",
"{",
"Exceptions",... | Finds the Result Entries that have a starting offset before the given offset, removes them from the collection,
and returns them.
@param maxOffset The offset to query against. | [
"Finds",
"the",
"Result",
"Entries",
"that",
"have",
"a",
"starting",
"offset",
"before",
"the",
"given",
"offset",
"removes",
"them",
"from",
"the",
"collection",
"and",
"returns",
"them",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/FutureReadResultEntryCollection.java#L85-L98 |
132,050 | pravega/pravega | client/src/main/java/io/pravega/client/segment/impl/SegmentInputStreamImpl.java | SegmentInputStreamImpl.issueRequestIfNeeded | private void issueRequestIfNeeded() {
//compute read length based on current offset up to which the events are read.
int updatedReadLength = computeReadLength(offset + buffer.dataAvailable());
if (!receivedEndOfSegment && !receivedTruncated && updatedReadLength > 0 && outstandingRequest == null)... | java | private void issueRequestIfNeeded() {
//compute read length based on current offset up to which the events are read.
int updatedReadLength = computeReadLength(offset + buffer.dataAvailable());
if (!receivedEndOfSegment && !receivedTruncated && updatedReadLength > 0 && outstandingRequest == null)... | [
"private",
"void",
"issueRequestIfNeeded",
"(",
")",
"{",
"//compute read length based on current offset up to which the events are read.",
"int",
"updatedReadLength",
"=",
"computeReadLength",
"(",
"offset",
"+",
"buffer",
".",
"dataAvailable",
"(",
")",
")",
";",
"if",
... | Issues a request
- if there is enough room for another request, and we aren't already waiting on one and
- if we have not read up to the configured endOffset. | [
"Issues",
"a",
"request",
"-",
"if",
"there",
"is",
"enough",
"room",
"for",
"another",
"request",
"and",
"we",
"aren",
"t",
"already",
"waiting",
"on",
"one",
"and",
"-",
"if",
"we",
"have",
"not",
"read",
"up",
"to",
"the",
"configured",
"endOffset",
... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/segment/impl/SegmentInputStreamImpl.java#L171-L178 |
132,051 | pravega/pravega | client/src/main/java/io/pravega/client/segment/impl/SegmentInputStreamImpl.java | SegmentInputStreamImpl.computeReadLength | private int computeReadLength(long currentFetchOffset) {
Preconditions.checkState(endOffset >= currentFetchOffset,
"Current offset up to to which events are fetched should be less than the configured end offset");
int currentReadLength = Math.max(minReadLength, buffer.capacityAvailable()... | java | private int computeReadLength(long currentFetchOffset) {
Preconditions.checkState(endOffset >= currentFetchOffset,
"Current offset up to to which events are fetched should be less than the configured end offset");
int currentReadLength = Math.max(minReadLength, buffer.capacityAvailable()... | [
"private",
"int",
"computeReadLength",
"(",
"long",
"currentFetchOffset",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"endOffset",
">=",
"currentFetchOffset",
",",
"\"Current offset up to to which events are fetched should be less than the configured end offset\"",
")",
";... | Compute the read length based on the current fetch offset and the configured end offset. | [
"Compute",
"the",
"read",
"length",
"based",
"on",
"the",
"current",
"fetch",
"offset",
"and",
"the",
"configured",
"end",
"offset",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/segment/impl/SegmentInputStreamImpl.java#L183-L192 |
132,052 | pravega/pravega | client/src/main/java/io/pravega/client/netty/impl/ConnectionPoolImpl.java | ConnectionPoolImpl.establishConnection | private CompletableFuture<Void> establishConnection(PravegaNodeUri location, FlowHandler handler) {
final Bootstrap b = getNettyBootstrap().handler(getChannelInitializer(location, handler));
// Initiate Connection.
final CompletableFuture<Void> connectionComplete = new CompletableFuture<>();
... | java | private CompletableFuture<Void> establishConnection(PravegaNodeUri location, FlowHandler handler) {
final Bootstrap b = getNettyBootstrap().handler(getChannelInitializer(location, handler));
// Initiate Connection.
final CompletableFuture<Void> connectionComplete = new CompletableFuture<>();
... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"establishConnection",
"(",
"PravegaNodeUri",
"location",
",",
"FlowHandler",
"handler",
")",
"{",
"final",
"Bootstrap",
"b",
"=",
"getNettyBootstrap",
"(",
")",
".",
"handler",
"(",
"getChannelInitializer",
"(",
"... | Establish a new connection to the Pravega Node.
@param location The Pravega Node Uri
@param handler The flow handler for the connection
@return A future, which completes once the connection has been established, returning a FlowHandler that can be used to create
flows on the connection. | [
"Establish",
"a",
"new",
"connection",
"to",
"the",
"Pravega",
"Node",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/netty/impl/ConnectionPoolImpl.java#L189-L214 |
132,053 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadIndexSummary.java | ReadIndexSummary.add | synchronized void add(long size, int generation) {
Preconditions.checkArgument(size >= 0, "size must be a non-negative number");
Preconditions.checkArgument(generation >= 0, "generation must be a non-negative number");
this.totalSize += size;
int newCount = this.generations.getOrDefault(... | java | synchronized void add(long size, int generation) {
Preconditions.checkArgument(size >= 0, "size must be a non-negative number");
Preconditions.checkArgument(generation >= 0, "generation must be a non-negative number");
this.totalSize += size;
int newCount = this.generations.getOrDefault(... | [
"synchronized",
"void",
"add",
"(",
"long",
"size",
",",
"int",
"generation",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"size",
">=",
"0",
",",
"\"size must be a non-negative number\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"generation"... | Records the addition of an element of the given size to the given generation.
@param size The size of the element to add.
@param generation The generation of the element to add. | [
"Records",
"the",
"addition",
"of",
"an",
"element",
"of",
"the",
"given",
"size",
"to",
"the",
"given",
"generation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadIndexSummary.java#L75-L81 |
132,054 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadIndexSummary.java | ReadIndexSummary.remove | synchronized void remove(long size, int generation) {
Preconditions.checkArgument(size >= 0, "size must be a non-negative number");
this.totalSize -= size;
if (this.totalSize < 0) {
this.totalSize = 0;
}
removeFromGeneration(generation);
} | java | synchronized void remove(long size, int generation) {
Preconditions.checkArgument(size >= 0, "size must be a non-negative number");
this.totalSize -= size;
if (this.totalSize < 0) {
this.totalSize = 0;
}
removeFromGeneration(generation);
} | [
"synchronized",
"void",
"remove",
"(",
"long",
"size",
",",
"int",
"generation",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"size",
">=",
"0",
",",
"\"size must be a non-negative number\"",
")",
";",
"this",
".",
"totalSize",
"-=",
"size",
";",
"if"... | Records the removal of an element of the given size from the given generation.
@param size The size of the element to remove.
@param generation The generation of the element to remove. | [
"Records",
"the",
"removal",
"of",
"an",
"element",
"of",
"the",
"given",
"size",
"from",
"the",
"given",
"generation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadIndexSummary.java#L89-L97 |
132,055 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadIndexSummary.java | ReadIndexSummary.toCacheStatus | synchronized CacheManager.CacheStatus toCacheStatus() {
AtomicInteger oldestGeneration = new AtomicInteger(Integer.MAX_VALUE);
AtomicInteger newestGeneration = new AtomicInteger(0);
this.generations.keySet().forEach(g -> {
if (oldestGeneration.get() > g) {
oldestGener... | java | synchronized CacheManager.CacheStatus toCacheStatus() {
AtomicInteger oldestGeneration = new AtomicInteger(Integer.MAX_VALUE);
AtomicInteger newestGeneration = new AtomicInteger(0);
this.generations.keySet().forEach(g -> {
if (oldestGeneration.get() > g) {
oldestGener... | [
"synchronized",
"CacheManager",
".",
"CacheStatus",
"toCacheStatus",
"(",
")",
"{",
"AtomicInteger",
"oldestGeneration",
"=",
"new",
"AtomicInteger",
"(",
"Integer",
".",
"MAX_VALUE",
")",
";",
"AtomicInteger",
"newestGeneration",
"=",
"new",
"AtomicInteger",
"(",
"... | Generates a CacheManager.CacheStatus object with the information in this ReadIndexSummary object. | [
"Generates",
"a",
"CacheManager",
".",
"CacheStatus",
"object",
"with",
"the",
"information",
"in",
"this",
"ReadIndexSummary",
"object",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/ReadIndexSummary.java#L115-L129 |
132,056 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/operations/CompletableOperation.java | CompletableOperation.fail | public void fail(Throwable ex) {
this.done = true;
if (this.failureHandler != null) {
Callbacks.invokeSafely(this.failureHandler, ex, cex -> log.error("Fail Callback invocation failure.", cex));
}
} | java | public void fail(Throwable ex) {
this.done = true;
if (this.failureHandler != null) {
Callbacks.invokeSafely(this.failureHandler, ex, cex -> log.error("Fail Callback invocation failure.", cex));
}
} | [
"public",
"void",
"fail",
"(",
"Throwable",
"ex",
")",
"{",
"this",
".",
"done",
"=",
"true",
";",
"if",
"(",
"this",
".",
"failureHandler",
"!=",
"null",
")",
"{",
"Callbacks",
".",
"invokeSafely",
"(",
"this",
".",
"failureHandler",
",",
"ex",
",",
... | Completes the operation with failure.
@param ex The causing exception. | [
"Completes",
"the",
"operation",
"with",
"failure",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/operations/CompletableOperation.java#L98-L103 |
132,057 | pravega/pravega | common/src/main/java/io/pravega/common/util/btree/PageWrapper.java | PageWrapper.wrapExisting | static PageWrapper wrapExisting(BTreePage page, PageWrapper parent, PagePointer pointer) {
return new PageWrapper(page, parent, pointer, false);
} | java | static PageWrapper wrapExisting(BTreePage page, PageWrapper parent, PagePointer pointer) {
return new PageWrapper(page, parent, pointer, false);
} | [
"static",
"PageWrapper",
"wrapExisting",
"(",
"BTreePage",
"page",
",",
"PageWrapper",
"parent",
",",
"PagePointer",
"pointer",
")",
"{",
"return",
"new",
"PageWrapper",
"(",
"page",
",",
"parent",
",",
"pointer",
",",
"false",
")",
";",
"}"
] | Creates a new instance of the PageWrapper class for an existing Page.
@param page Page to wrap.
@param parent Page's Parent.
@param pointer Page Pointer. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"PageWrapper",
"class",
"for",
"an",
"existing",
"Page",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/PageWrapper.java#L58-L60 |
132,058 | pravega/pravega | common/src/main/java/io/pravega/common/util/btree/PageWrapper.java | PageWrapper.wrapNew | static PageWrapper wrapNew(BTreePage page, PageWrapper parent, PagePointer pointer) {
return new PageWrapper(page, parent, pointer, true);
} | java | static PageWrapper wrapNew(BTreePage page, PageWrapper parent, PagePointer pointer) {
return new PageWrapper(page, parent, pointer, true);
} | [
"static",
"PageWrapper",
"wrapNew",
"(",
"BTreePage",
"page",
",",
"PageWrapper",
"parent",
",",
"PagePointer",
"pointer",
")",
"{",
"return",
"new",
"PageWrapper",
"(",
"page",
",",
"parent",
",",
"pointer",
",",
"true",
")",
";",
"}"
] | Creates a new instance of the PageWrapper class for a new Page.
@param page Page to wrap.
@param parent Page's Parent.
@param pointer Page Pointer. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"PageWrapper",
"class",
"for",
"a",
"new",
"Page",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/PageWrapper.java#L69-L71 |
132,059 | pravega/pravega | common/src/main/java/io/pravega/common/util/btree/PageWrapper.java | PageWrapper.setOffset | void setOffset(long value) {
if (this.pointer != null && this.offset.get() != this.pointer.getOffset()) {
// We have already assigned an offset to this.
throw new IllegalStateException("Cannot assign offset more than once.");
}
this.offset.set(value);
} | java | void setOffset(long value) {
if (this.pointer != null && this.offset.get() != this.pointer.getOffset()) {
// We have already assigned an offset to this.
throw new IllegalStateException("Cannot assign offset more than once.");
}
this.offset.set(value);
} | [
"void",
"setOffset",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"this",
".",
"pointer",
"!=",
"null",
"&&",
"this",
".",
"offset",
".",
"get",
"(",
")",
"!=",
"this",
".",
"pointer",
".",
"getOffset",
"(",
")",
")",
"{",
"// We have already assigned an... | Updates the offset of the wrapped BTreePage.
@param value The offset to assign. | [
"Updates",
"the",
"offset",
"of",
"the",
"wrapped",
"BTreePage",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/PageWrapper.java#L138-L145 |
132,060 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.rebase | void rebase(ContainerMetadata baseMetadata) {
Preconditions.checkArgument(baseMetadata.getContainerId() == this.containerId, "ContainerId mismatch");
Preconditions.checkArgument(baseMetadata.isRecoveryMode() == this.isRecoveryMode(), "isRecoveryMode mismatch");
this.baseMetadata = baseMetadata;
... | java | void rebase(ContainerMetadata baseMetadata) {
Preconditions.checkArgument(baseMetadata.getContainerId() == this.containerId, "ContainerId mismatch");
Preconditions.checkArgument(baseMetadata.isRecoveryMode() == this.isRecoveryMode(), "isRecoveryMode mismatch");
this.baseMetadata = baseMetadata;
... | [
"void",
"rebase",
"(",
"ContainerMetadata",
"baseMetadata",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"baseMetadata",
".",
"getContainerId",
"(",
")",
"==",
"this",
".",
"containerId",
",",
"\"ContainerId mismatch\"",
")",
";",
"Preconditions",
".",
"c... | Rebases this UpdateTransaction to the given ContainerMetadata.
@param baseMetadata The ContainerMetadata to rebase onto. | [
"Rebases",
"this",
"UpdateTransaction",
"to",
"the",
"given",
"ContainerMetadata",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L208-L215 |
132,061 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.commit | void commit(UpdateableContainerMetadata target) {
Preconditions.checkArgument(target.getContainerId() == this.containerId, "ContainerId mismatch");
Preconditions.checkArgument(target.isRecoveryMode() == this.isRecoveryMode(), "isRecoveryMode mismatch");
if (target.isRecoveryMode()) {
... | java | void commit(UpdateableContainerMetadata target) {
Preconditions.checkArgument(target.getContainerId() == this.containerId, "ContainerId mismatch");
Preconditions.checkArgument(target.isRecoveryMode() == this.isRecoveryMode(), "isRecoveryMode mismatch");
if (target.isRecoveryMode()) {
... | [
"void",
"commit",
"(",
"UpdateableContainerMetadata",
"target",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"target",
".",
"getContainerId",
"(",
")",
"==",
"this",
".",
"containerId",
",",
"\"ContainerId mismatch\"",
")",
";",
"Preconditions",
".",
"che... | Commits all pending changes to the given target Container Metadata.
@param target The UpdateableContainerMetadata to commit to. | [
"Commits",
"all",
"pending",
"changes",
"to",
"the",
"given",
"target",
"Container",
"Metadata",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L221-L257 |
132,062 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.preProcessOperation | void preProcessOperation(Operation operation) throws ContainerException, StreamSegmentException {
checkNotSealed();
if (operation instanceof SegmentOperation) {
val segmentMetadata = getSegmentUpdateTransaction(((SegmentOperation) operation).getStreamSegmentId());
if (segmentMeta... | java | void preProcessOperation(Operation operation) throws ContainerException, StreamSegmentException {
checkNotSealed();
if (operation instanceof SegmentOperation) {
val segmentMetadata = getSegmentUpdateTransaction(((SegmentOperation) operation).getStreamSegmentId());
if (segmentMeta... | [
"void",
"preProcessOperation",
"(",
"Operation",
"operation",
")",
"throws",
"ContainerException",
",",
"StreamSegmentException",
"{",
"checkNotSealed",
"(",
")",
";",
"if",
"(",
"operation",
"instanceof",
"SegmentOperation",
")",
"{",
"val",
"segmentMetadata",
"=",
... | Pre-processes the given Operation. See OperationMetadataUpdater.preProcessOperation for more details on behavior.
@param operation The operation to pre-process.
@throws ContainerException If the given operation was rejected given the current state of the container metadata.
@throws StreamSegmentException If the gi... | [
"Pre",
"-",
"processes",
"the",
"given",
"Operation",
".",
"See",
"OperationMetadataUpdater",
".",
"preProcessOperation",
"for",
"more",
"details",
"on",
"behavior",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L304-L338 |
132,063 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.acceptOperation | void acceptOperation(Operation operation) throws MetadataUpdateException {
checkNotSealed();
if (operation instanceof SegmentOperation) {
val segmentMetadata = getSegmentUpdateTransaction(((SegmentOperation) operation).getStreamSegmentId());
segmentMetadata.setLastUsed(operation.... | java | void acceptOperation(Operation operation) throws MetadataUpdateException {
checkNotSealed();
if (operation instanceof SegmentOperation) {
val segmentMetadata = getSegmentUpdateTransaction(((SegmentOperation) operation).getStreamSegmentId());
segmentMetadata.setLastUsed(operation.... | [
"void",
"acceptOperation",
"(",
"Operation",
"operation",
")",
"throws",
"MetadataUpdateException",
"{",
"checkNotSealed",
"(",
")",
";",
"if",
"(",
"operation",
"instanceof",
"SegmentOperation",
")",
"{",
"val",
"segmentMetadata",
"=",
"getSegmentUpdateTransaction",
... | Accepts the given Operation. The Operation's effects are reflected in the pending transaction.
This method has no effect on Metadata Operations.
See OperationMetadataUpdater.acceptOperation for more details on behavior.
@param operation The operation to accept.
@throws MetadataUpdateException If the given operation wa... | [
"Accepts",
"the",
"given",
"Operation",
".",
"The",
"Operation",
"s",
"effects",
"are",
"reflected",
"in",
"the",
"pending",
"transaction",
".",
"This",
"method",
"has",
"no",
"effect",
"on",
"Metadata",
"Operations",
".",
"See",
"OperationMetadataUpdater",
".",... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L349-L379 |
132,064 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.getSegmentUpdateTransaction | private SegmentMetadataUpdateTransaction getSegmentUpdateTransaction(long segmentId) throws MetadataUpdateException {
SegmentMetadataUpdateTransaction tsm = tryGetSegmentUpdateTransaction(segmentId);
if (tsm == null) {
throw new MetadataUpdateException(this.containerId, String.format("No met... | java | private SegmentMetadataUpdateTransaction getSegmentUpdateTransaction(long segmentId) throws MetadataUpdateException {
SegmentMetadataUpdateTransaction tsm = tryGetSegmentUpdateTransaction(segmentId);
if (tsm == null) {
throw new MetadataUpdateException(this.containerId, String.format("No met... | [
"private",
"SegmentMetadataUpdateTransaction",
"getSegmentUpdateTransaction",
"(",
"long",
"segmentId",
")",
"throws",
"MetadataUpdateException",
"{",
"SegmentMetadataUpdateTransaction",
"tsm",
"=",
"tryGetSegmentUpdateTransaction",
"(",
"segmentId",
")",
";",
"if",
"(",
"tsm... | Gets all pending changes for the given Segment.
@param segmentId The Id of the Segment to query.
@throws MetadataUpdateException If no metadata entry exists for the given Segment Id. | [
"Gets",
"all",
"pending",
"changes",
"for",
"the",
"given",
"Segment",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L512-L519 |
132,065 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.getOrCreateSegmentUpdateTransaction | private SegmentMetadataUpdateTransaction getOrCreateSegmentUpdateTransaction(String segmentName, long segmentId) {
SegmentMetadataUpdateTransaction sm = tryGetSegmentUpdateTransaction(segmentId);
if (sm == null) {
SegmentMetadata baseSegmentMetadata = createSegmentMetadata(segmentName, segme... | java | private SegmentMetadataUpdateTransaction getOrCreateSegmentUpdateTransaction(String segmentName, long segmentId) {
SegmentMetadataUpdateTransaction sm = tryGetSegmentUpdateTransaction(segmentId);
if (sm == null) {
SegmentMetadata baseSegmentMetadata = createSegmentMetadata(segmentName, segme... | [
"private",
"SegmentMetadataUpdateTransaction",
"getOrCreateSegmentUpdateTransaction",
"(",
"String",
"segmentName",
",",
"long",
"segmentId",
")",
"{",
"SegmentMetadataUpdateTransaction",
"sm",
"=",
"tryGetSegmentUpdateTransaction",
"(",
"segmentId",
")",
";",
"if",
"(",
"s... | Gets an UpdateableSegmentMetadata for the given Segment. If already registered, it returns that instance,
otherwise it creates and records a new Segment metadata. | [
"Gets",
"an",
"UpdateableSegmentMetadata",
"for",
"the",
"given",
"Segment",
".",
"If",
"already",
"registered",
"it",
"returns",
"that",
"instance",
"otherwise",
"it",
"creates",
"and",
"records",
"a",
"new",
"Segment",
"metadata",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L525-L534 |
132,066 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.tryGetSegmentUpdateTransaction | private SegmentMetadataUpdateTransaction tryGetSegmentUpdateTransaction(long segmentId) {
SegmentMetadataUpdateTransaction sm = this.segmentUpdates.getOrDefault(segmentId, null);
if (sm == null) {
SegmentMetadata baseSegmentMetadata = this.baseMetadata.getStreamSegmentMetadata(segmentId);
... | java | private SegmentMetadataUpdateTransaction tryGetSegmentUpdateTransaction(long segmentId) {
SegmentMetadataUpdateTransaction sm = this.segmentUpdates.getOrDefault(segmentId, null);
if (sm == null) {
SegmentMetadata baseSegmentMetadata = this.baseMetadata.getStreamSegmentMetadata(segmentId);
... | [
"private",
"SegmentMetadataUpdateTransaction",
"tryGetSegmentUpdateTransaction",
"(",
"long",
"segmentId",
")",
"{",
"SegmentMetadataUpdateTransaction",
"sm",
"=",
"this",
".",
"segmentUpdates",
".",
"getOrDefault",
"(",
"segmentId",
",",
"null",
")",
";",
"if",
"(",
... | Attempts to get a SegmentMetadataUpdateTransaction for an existing or new Segment.
@param segmentId The Id of the Segment to retrieve.
@return An instance of SegmentMetadataUpdateTransaction, or null if no such segment exists. | [
"Attempts",
"to",
"get",
"a",
"SegmentMetadataUpdateTransaction",
"for",
"an",
"existing",
"or",
"new",
"Segment",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L542-L557 |
132,067 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java | ContainerMetadataUpdateTransaction.createSegmentMetadata | private UpdateableSegmentMetadata createSegmentMetadata(String segmentName, long segmentId) {
UpdateableSegmentMetadata metadata = new StreamSegmentMetadata(segmentName, segmentId, this.containerId);
this.newSegments.put(metadata.getId(), metadata);
this.newSegmentNames.put(metadata.getName(), m... | java | private UpdateableSegmentMetadata createSegmentMetadata(String segmentName, long segmentId) {
UpdateableSegmentMetadata metadata = new StreamSegmentMetadata(segmentName, segmentId, this.containerId);
this.newSegments.put(metadata.getId(), metadata);
this.newSegmentNames.put(metadata.getName(), m... | [
"private",
"UpdateableSegmentMetadata",
"createSegmentMetadata",
"(",
"String",
"segmentName",
",",
"long",
"segmentId",
")",
"{",
"UpdateableSegmentMetadata",
"metadata",
"=",
"new",
"StreamSegmentMetadata",
"(",
"segmentName",
",",
"segmentId",
",",
"this",
".",
"cont... | Creates a new UpdateableSegmentMetadata for the given Segment and registers it. | [
"Creates",
"a",
"new",
"UpdateableSegmentMetadata",
"for",
"the",
"given",
"Segment",
"and",
"registers",
"it",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/ContainerMetadataUpdateTransaction.java#L562-L567 |
132,068 | pravega/pravega | common/src/main/java/io/pravega/common/io/FixedByteArrayOutputStream.java | FixedByteArrayOutputStream.write | @Override
public void write(int b) throws IOException {
if (this.isClosed) {
throw new IOException("OutputStream is closed.");
}
if (this.position >= this.length) {
throw new IOException("Buffer capacity exceeded.");
}
this.array[this.offset + this.p... | java | @Override
public void write(int b) throws IOException {
if (this.isClosed) {
throw new IOException("OutputStream is closed.");
}
if (this.position >= this.length) {
throw new IOException("Buffer capacity exceeded.");
}
this.array[this.offset + this.p... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"int",
"b",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"isClosed",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"OutputStream is closed.\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"posit... | region OutputStream and RandomAccessOutputStream Implementation | [
"region",
"OutputStream",
"and",
"RandomAccessOutputStream",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/FixedByteArrayOutputStream.java#L58-L70 |
132,069 | pravega/pravega | controller/src/main/java/io/pravega/controller/server/rpc/auth/PravegaInterceptor.java | PravegaInterceptor.retrieveMasterToken | public static String retrieveMasterToken(String tokenSigningKey) {
Map<String, Object> claims = new HashMap<>();
claims.put("*", String.valueOf(READ_UPDATE));
return Jwts.builder()
.setSubject("segmentstoreresource")
.setAudience("segmentstore")
... | java | public static String retrieveMasterToken(String tokenSigningKey) {
Map<String, Object> claims = new HashMap<>();
claims.put("*", String.valueOf(READ_UPDATE));
return Jwts.builder()
.setSubject("segmentstoreresource")
.setAudience("segmentstore")
... | [
"public",
"static",
"String",
"retrieveMasterToken",
"(",
"String",
"tokenSigningKey",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"claims",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"claims",
".",
"put",
"(",
"\"*\"",
",",
"String",
".",
"valu... | Retrieves a master token for internal controller to segmentstore communication.
@param tokenSigningKey Signing key for the JWT token.
@return A new master token which has highest privileges. | [
"Retrieves",
"a",
"master",
"token",
"for",
"internal",
"controller",
"to",
"segmentstore",
"communication",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rpc/auth/PravegaInterceptor.java#L90-L101 |
132,070 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/AsyncTableEntryReader.java | AsyncTableEntryReader.shouldRequestContents | @Override
public boolean shouldRequestContents(ReadResultEntryType entryType, long streamSegmentOffset) {
// We only care about data that has already been written, so this implies Cache and Storage.
// Additionally, given that the Store acks an append prior to inserting it into the cache (but after ... | java | @Override
public boolean shouldRequestContents(ReadResultEntryType entryType, long streamSegmentOffset) {
// We only care about data that has already been written, so this implies Cache and Storage.
// Additionally, given that the Store acks an append prior to inserting it into the cache (but after ... | [
"@",
"Override",
"public",
"boolean",
"shouldRequestContents",
"(",
"ReadResultEntryType",
"entryType",
",",
"long",
"streamSegmentOffset",
")",
"{",
"// We only care about data that has already been written, so this implies Cache and Storage.",
"// Additionally, given that the Store ack... | region AsyncReadResultHandler implementation | [
"region",
"AsyncReadResultHandler",
"implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/AsyncTableEntryReader.java#L160-L166 |
132,071 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/operations/CheckpointOperationBase.java | CheckpointOperationBase.setContents | public void setContents(ByteArraySegment contents) {
Preconditions.checkNotNull(contents, "contents");
Preconditions.checkState(this.contents == null, "This operation has already had its contents set.");
this.contents = contents;
} | java | public void setContents(ByteArraySegment contents) {
Preconditions.checkNotNull(contents, "contents");
Preconditions.checkState(this.contents == null, "This operation has already had its contents set.");
this.contents = contents;
} | [
"public",
"void",
"setContents",
"(",
"ByteArraySegment",
"contents",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"contents",
",",
"\"contents\"",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"this",
".",
"contents",
"==",
"null",
",",
"\"This ope... | Sets the Contents of this MetadataCheckpointOperation.
@param contents The contents to set. | [
"Sets",
"the",
"Contents",
"of",
"this",
"MetadataCheckpointOperation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/operations/CheckpointOperationBase.java#L35-L39 |
132,072 | pravega/pravega | common/src/main/java/io/pravega/common/util/btree/ByteArrayComparator.java | ByteArrayComparator.compare | int compare(ByteArraySegment b1, ByteArraySegment b2) {
assert b1.getLength() == b2.getLength();
return compare(b1.array(), b1.arrayOffset(), b2.array(), b2.arrayOffset(), b1.getLength());
} | java | int compare(ByteArraySegment b1, ByteArraySegment b2) {
assert b1.getLength() == b2.getLength();
return compare(b1.array(), b1.arrayOffset(), b2.array(), b2.arrayOffset(), b1.getLength());
} | [
"int",
"compare",
"(",
"ByteArraySegment",
"b1",
",",
"ByteArraySegment",
"b2",
")",
"{",
"assert",
"b1",
".",
"getLength",
"(",
")",
"==",
"b2",
".",
"getLength",
"(",
")",
";",
"return",
"compare",
"(",
"b1",
".",
"array",
"(",
")",
",",
"b1",
".",... | Compares two non-null ByteArraySegments of the same length using lexicographic bitwise comparison.
@param b1 First instance.
@param b2 Second instance.
@return -1 if b1 should be before b2, 0 if b1 equals b2 and 1 if b1 should be after b2. | [
"Compares",
"two",
"non",
"-",
"null",
"ByteArraySegments",
"of",
"the",
"same",
"length",
"using",
"lexicographic",
"bitwise",
"comparison",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/ByteArrayComparator.java#L64-L67 |
132,073 | pravega/pravega | common/src/main/java/io/pravega/common/util/btree/ByteArrayComparator.java | ByteArrayComparator.compare | int compare(byte[] b1, int offset1, byte[] b2, int offset2, int length) {
int r;
for (int i = 0; i < length; i++) {
// Unsigned comparison mimics bitwise comparison.
r = (b1[offset1 + i] & 0xFF) - (b2[offset2 + i] & 0xFF);
if (r != 0) {
return r;
... | java | int compare(byte[] b1, int offset1, byte[] b2, int offset2, int length) {
int r;
for (int i = 0; i < length; i++) {
// Unsigned comparison mimics bitwise comparison.
r = (b1[offset1 + i] & 0xFF) - (b2[offset2 + i] & 0xFF);
if (r != 0) {
return r;
... | [
"int",
"compare",
"(",
"byte",
"[",
"]",
"b1",
",",
"int",
"offset1",
",",
"byte",
"[",
"]",
"b2",
",",
"int",
"offset2",
",",
"int",
"length",
")",
"{",
"int",
"r",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
... | Compares two byte arrays from the given offsets using lexicographic bitwise comparison.
@param b1 First array.
@param offset1 The first offset to begin comparing in the first array.
@param b2 Second array.
@param offset2 The first offset to begin comparing in the second array.
@param length The number of by... | [
"Compares",
"two",
"byte",
"arrays",
"from",
"the",
"given",
"offsets",
"using",
"lexicographic",
"bitwise",
"comparison",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/ByteArrayComparator.java#L79-L90 |
132,074 | pravega/pravega | common/src/main/java/io/pravega/common/concurrent/AbstractThreadPoolService.java | AbstractThreadPoolService.notifyStoppedOrFailed | private void notifyStoppedOrFailed(Throwable runException) {
final Throwable stopException = this.stopException.get();
if (runException == null) {
// If runTask did not fail with an exception, see if we have a general stopException.
runException = stopException;
}
... | java | private void notifyStoppedOrFailed(Throwable runException) {
final Throwable stopException = this.stopException.get();
if (runException == null) {
// If runTask did not fail with an exception, see if we have a general stopException.
runException = stopException;
}
... | [
"private",
"void",
"notifyStoppedOrFailed",
"(",
"Throwable",
"runException",
")",
"{",
"final",
"Throwable",
"stopException",
"=",
"this",
".",
"stopException",
".",
"get",
"(",
")",
";",
"if",
"(",
"runException",
"==",
"null",
")",
"{",
"// If runTask did not... | Notifies the AbstractService to enter the TERMINATED or FAILED state, based on the current state of the Service
and the given Exception.
@param runException (Optional) A Throwable that indicates the failure cause of runTask. | [
"Notifies",
"the",
"AbstractService",
"to",
"enter",
"the",
"TERMINATED",
"or",
"FAILED",
"state",
"based",
"on",
"the",
"current",
"state",
"of",
"the",
"Service",
"and",
"the",
"given",
"Exception",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/AbstractThreadPoolService.java#L131-L161 |
132,075 | pravega/pravega | controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/SealStreamTask.java | SealStreamTask.abortTransaction | private CompletableFuture<Boolean> abortTransaction(OperationContext context, String scope, String stream, long requestId) {
return streamMetadataStore.getActiveTxns(scope, stream, context, executor)
.thenCompose(activeTxns -> {
if (activeTxns == null || activeTxns.isEmpty())... | java | private CompletableFuture<Boolean> abortTransaction(OperationContext context, String scope, String stream, long requestId) {
return streamMetadataStore.getActiveTxns(scope, stream, context, executor)
.thenCompose(activeTxns -> {
if (activeTxns == null || activeTxns.isEmpty())... | [
"private",
"CompletableFuture",
"<",
"Boolean",
">",
"abortTransaction",
"(",
"OperationContext",
"context",
",",
"String",
"scope",
",",
"String",
"stream",
",",
"long",
"requestId",
")",
"{",
"return",
"streamMetadataStore",
".",
"getActiveTxns",
"(",
"scope",
"... | A method that issues abort request for all outstanding transactions on the stream, which are processed asynchronously.
This method returns false if it found transactions to abort, true otherwise.
@param context operation context
@param scope scope
@param stream stream
@param requestId requestId
@return CompletableFutur... | [
"A",
"method",
"that",
"issues",
"abort",
"request",
"for",
"all",
"outstanding",
"transactions",
"on",
"the",
"stream",
"which",
"are",
"processed",
"asynchronously",
".",
"This",
"method",
"returns",
"false",
"if",
"it",
"found",
"transactions",
"to",
"abort",... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/SealStreamTask.java#L108-L154 |
132,076 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/ZooKeeperServiceRunner.java | ZooKeeperServiceRunner.start | public void start() throws Exception {
Preconditions.checkState(this.tmpDir.get() != null, "Not Initialized.");
val s = new ZooKeeperServer(this.tmpDir.get(), this.tmpDir.get(), ZooKeeperServer.DEFAULT_TICK_TIME);
if (!this.server.compareAndSet(null, s)) {
s.shutdown();
t... | java | public void start() throws Exception {
Preconditions.checkState(this.tmpDir.get() != null, "Not Initialized.");
val s = new ZooKeeperServer(this.tmpDir.get(), this.tmpDir.get(), ZooKeeperServer.DEFAULT_TICK_TIME);
if (!this.server.compareAndSet(null, s)) {
s.shutdown();
t... | [
"public",
"void",
"start",
"(",
")",
"throws",
"Exception",
"{",
"Preconditions",
".",
"checkState",
"(",
"this",
".",
"tmpDir",
".",
"get",
"(",
")",
"!=",
"null",
",",
"\"Not Initialized.\"",
")",
";",
"val",
"s",
"=",
"new",
"ZooKeeperServer",
"(",
"t... | Starts the ZooKeeper Service in process.
@throws Exception If an exception occurred. | [
"Starts",
"the",
"ZooKeeper",
"Service",
"in",
"process",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/ZooKeeperServiceRunner.java#L104-L120 |
132,077 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/ZooKeeperServiceRunner.java | ZooKeeperServiceRunner.waitForServerUp | public static boolean waitForServerUp(int zkPort, boolean secureZk, String trustStore, String keyStore,
String keyStorePasswordPath, String trustStorePasswordPath) {
val address = LOOPBACK_ADDRESS + ":" + zkPort;
if (secureZk) {
return waitForSSLServ... | java | public static boolean waitForServerUp(int zkPort, boolean secureZk, String trustStore, String keyStore,
String keyStorePasswordPath, String trustStorePasswordPath) {
val address = LOOPBACK_ADDRESS + ":" + zkPort;
if (secureZk) {
return waitForSSLServ... | [
"public",
"static",
"boolean",
"waitForServerUp",
"(",
"int",
"zkPort",
",",
"boolean",
"secureZk",
",",
"String",
"trustStore",
",",
"String",
"keyStore",
",",
"String",
"keyStorePasswordPath",
",",
"String",
"trustStorePasswordPath",
")",
"{",
"val",
"address",
... | Blocks the current thread and awaits ZooKeeper to start running locally on the given port.
@param zkPort The ZooKeeper Port.
@param secureZk Flag to notify whether the ZK is secure.
@param trustStore Location of the trust store.
@param keyStore Location of the key store.
@param keyStorePasswordPath Location of passwor... | [
"Blocks",
"the",
"current",
"thread",
"and",
"awaits",
"ZooKeeper",
"to",
"start",
"running",
"locally",
"on",
"the",
"given",
"port",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/ZooKeeperServiceRunner.java#L170-L179 |
132,078 | pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/ZooKeeperServiceRunner.java | ZooKeeperServiceRunner.main | public static void main(String[] args) throws Exception {
int zkPort;
boolean secureZK = false;
String zkKeyStore;
String zkKeyStorePasswd = null;
String zkTrustStore = null;
try {
zkPort = Integer.parseInt(System.getProperty(PROPERTY_ZK_PORT));
se... | java | public static void main(String[] args) throws Exception {
int zkPort;
boolean secureZK = false;
String zkKeyStore;
String zkKeyStorePasswd = null;
String zkTrustStore = null;
try {
zkPort = Integer.parseInt(System.getProperty(PROPERTY_ZK_PORT));
se... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"int",
"zkPort",
";",
"boolean",
"secureZK",
"=",
"false",
";",
"String",
"zkKeyStore",
";",
"String",
"zkKeyStorePasswd",
"=",
"null",
";",
"String",
"zk... | Main method that can be used to start ZooKeeper 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",
"ZooKeeper",
"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/ZooKeeperServiceRunner.java#L258-L282 |
132,079 | pravega/pravega | bindings/src/main/java/io/pravega/storage/hdfs/HDFSExceptionHelpers.java | HDFSExceptionHelpers.convertException | static <T> StreamSegmentException convertException(String segmentName, Throwable e) {
if (e instanceof RemoteException) {
e = ((RemoteException) e).unwrapRemoteException();
}
if (e instanceof PathNotFoundException || e instanceof FileNotFoundException) {
return new Strea... | java | static <T> StreamSegmentException convertException(String segmentName, Throwable e) {
if (e instanceof RemoteException) {
e = ((RemoteException) e).unwrapRemoteException();
}
if (e instanceof PathNotFoundException || e instanceof FileNotFoundException) {
return new Strea... | [
"static",
"<",
"T",
">",
"StreamSegmentException",
"convertException",
"(",
"String",
"segmentName",
",",
"Throwable",
"e",
")",
"{",
"if",
"(",
"e",
"instanceof",
"RemoteException",
")",
"{",
"e",
"=",
"(",
"(",
"RemoteException",
")",
"e",
")",
".",
"unw... | Translates HDFS specific Exceptions to Pravega-equivalent Exceptions.
@param segmentName Name of the stream segment on which the exception occurs.
@param e The exception to be translated.
@return The exception to be thrown. | [
"Translates",
"HDFS",
"specific",
"Exceptions",
"to",
"Pravega",
"-",
"equivalent",
"Exceptions",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/bindings/src/main/java/io/pravega/storage/hdfs/HDFSExceptionHelpers.java#L36-L50 |
132,080 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java | StorageWriter.readData | private CompletableFuture<Iterator<Operation>> readData(Void ignored) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "readData");
try {
Duration readTimeout = getReadTimeout();
return this.dataSource
.read(this.state.getLastReadS... | java | private CompletableFuture<Iterator<Operation>> readData(Void ignored) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "readData");
try {
Duration readTimeout = getReadTimeout();
return this.dataSource
.read(this.state.getLastReadS... | [
"private",
"CompletableFuture",
"<",
"Iterator",
"<",
"Operation",
">",
">",
"readData",
"(",
"Void",
"ignored",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"traceObjectId",
",",
"\"readData\"",
... | Reads data from the OperationLog.
@return A CompletableFuture that, when complete, will indicate that the read has been performed in its entirety. | [
"Reads",
"data",
"from",
"the",
"OperationLog",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java#L177-L209 |
132,081 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java | StorageWriter.processReadResult | private CompletableFuture<Void> processReadResult(Iterator<Operation> readResult) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "processReadResult");
InputReadStageResult result = new InputReadStageResult(this.state);
if (readResult == null) {
// This ... | java | private CompletableFuture<Void> processReadResult(Iterator<Operation> readResult) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "processReadResult");
InputReadStageResult result = new InputReadStageResult(this.state);
if (readResult == null) {
// This ... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"processReadResult",
"(",
"Iterator",
"<",
"Operation",
">",
"readResult",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"traceObjectId",
",",
"\"p... | Processes all the operations in the given ReadResult.
@param readResult The read result to process. | [
"Processes",
"all",
"the",
"operations",
"in",
"the",
"given",
"ReadResult",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java#L216-L242 |
132,082 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java | StorageWriter.flush | private CompletableFuture<Void> flush(Void ignored) {
checkRunning();
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "flush");
// Flush everything we can flush.
val flushFutures = this.processors.values().stream()
.f... | java | private CompletableFuture<Void> flush(Void ignored) {
checkRunning();
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "flush");
// Flush everything we can flush.
val flushFutures = this.processors.values().stream()
.f... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"flush",
"(",
"Void",
"ignored",
")",
"{",
"checkRunning",
"(",
")",
";",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"traceObjectId",
",",
"\"flush\"",
... | Flushes eligible operations to Storage, if necessary. Does not perform any mergers. | [
"Flushes",
"eligible",
"operations",
"to",
"Storage",
"if",
"necessary",
".",
"Does",
"not",
"perform",
"any",
"mergers",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java#L293-L314 |
132,083 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java | StorageWriter.cleanup | private void cleanup() {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "cleanup");
val toRemove = this.processors.values().stream()
.map(this::closeIfNecessary)
.filter(ProcessorCollection::isClosed... | java | private void cleanup() {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "cleanup");
val toRemove = this.processors.values().stream()
.map(this::closeIfNecessary)
.filter(ProcessorCollection::isClosed... | [
"private",
"void",
"cleanup",
"(",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"traceObjectId",
",",
"\"cleanup\"",
")",
";",
"val",
"toRemove",
"=",
"this",
".",
"processors",
".",
"values",... | Cleans up all SegmentAggregators that are currently closed. | [
"Cleans",
"up",
"all",
"SegmentAggregators",
"that",
"are",
"currently",
"closed",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java#L319-L328 |
132,084 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java | StorageWriter.acknowledge | private CompletableFuture<Void> acknowledge(Void ignored) {
checkRunning();
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "acknowledge");
long highestCommittedSeqNo = this.ackCalculator.getHighestCommittedSequenceNumber(this.processors.values());
long ackSe... | java | private CompletableFuture<Void> acknowledge(Void ignored) {
checkRunning();
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "acknowledge");
long highestCommittedSeqNo = this.ackCalculator.getHighestCommittedSequenceNumber(this.processors.values());
long ackSe... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"acknowledge",
"(",
"Void",
"ignored",
")",
"{",
"checkRunning",
"(",
")",
";",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"this",
".",
"traceObjectId",
",",
"\"ackn... | Acknowledges operations that were flushed to storage | [
"Acknowledges",
"operations",
"that",
"were",
"flushed",
"to",
"storage"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java#L347-L367 |
132,085 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java | StorageWriter.getProcessor | private CompletableFuture<ProcessorCollection> getProcessor(long streamSegmentId) {
ProcessorCollection existingProcessor = this.processors.getOrDefault(streamSegmentId, null);
if (existingProcessor != null) {
if (closeIfNecessary(existingProcessor).isClosed()) {
// Existing ... | java | private CompletableFuture<ProcessorCollection> getProcessor(long streamSegmentId) {
ProcessorCollection existingProcessor = this.processors.getOrDefault(streamSegmentId, null);
if (existingProcessor != null) {
if (closeIfNecessary(existingProcessor).isClosed()) {
// Existing ... | [
"private",
"CompletableFuture",
"<",
"ProcessorCollection",
">",
"getProcessor",
"(",
"long",
"streamSegmentId",
")",
"{",
"ProcessorCollection",
"existingProcessor",
"=",
"this",
".",
"processors",
".",
"getOrDefault",
"(",
"streamSegmentId",
",",
"null",
")",
";",
... | Gets, or creates, a SegmentAggregator for the given StorageOperation.
@param streamSegmentId The Id of the StreamSegment to get the aggregator for. | [
"Gets",
"or",
"creates",
"a",
"SegmentAggregator",
"for",
"the",
"given",
"StorageOperation",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/StorageWriter.java#L378-L412 |
132,086 | pravega/pravega | common/src/main/java/io/pravega/common/LoggerHelpers.java | LoggerHelpers.traceLeave | public static void traceLeave(Logger log, String method, long traceEnterId, Object... args) {
if (!log.isTraceEnabled()) {
return;
}
if (args.length == 0) {
log.trace("LEAVE {}@{} (elapsed={}us).", method, traceEnterId, ELAPSED_MICRO.apply(traceEnterId));
} else ... | java | public static void traceLeave(Logger log, String method, long traceEnterId, Object... args) {
if (!log.isTraceEnabled()) {
return;
}
if (args.length == 0) {
log.trace("LEAVE {}@{} (elapsed={}us).", method, traceEnterId, ELAPSED_MICRO.apply(traceEnterId));
} else ... | [
"public",
"static",
"void",
"traceLeave",
"(",
"Logger",
"log",
",",
"String",
"method",
",",
"long",
"traceEnterId",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"log",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
... | Traces the fact that a method has exited normally.
@param log The Logger to log to.
@param method The name of the method.
@param traceEnterId The correlation Id obtained from a traceEnter call.
@param args Additional arguments to log. | [
"Traces",
"the",
"fact",
"that",
"a",
"method",
"has",
"exited",
"normally",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/LoggerHelpers.java#L80-L90 |
132,087 | pravega/pravega | shared/protocol/src/main/java/io/pravega/shared/NameUtils.java | NameUtils.validateUserStreamName | public static String validateUserStreamName(String name) {
Preconditions.checkNotNull(name);
Preconditions.checkArgument(name.matches("[\\p{Alnum}\\.\\-]+"), "Name must be a-z, 0-9, ., -.");
return name;
} | java | public static String validateUserStreamName(String name) {
Preconditions.checkNotNull(name);
Preconditions.checkArgument(name.matches("[\\p{Alnum}\\.\\-]+"), "Name must be a-z, 0-9, ., -.");
return name;
} | [
"public",
"static",
"String",
"validateUserStreamName",
"(",
"String",
"name",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"name",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"name",
".",
"matches",
"(",
"\"[\\\\p{Alnum}\\\\.\\\\-]+\"",
")",
","... | Validates a user created stream name.
@param name User supplied stream name to validate.
@return The name in the case is valid. | [
"Validates",
"a",
"user",
"created",
"stream",
"name",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/NameUtils.java#L55-L59 |
132,088 | pravega/pravega | shared/protocol/src/main/java/io/pravega/shared/NameUtils.java | NameUtils.validateStreamName | public static String validateStreamName(String name) {
Preconditions.checkNotNull(name);
// In addition to user stream names, pravega internally created stream have a special prefix.
final String matcher = "[" + INTERNAL_NAME_PREFIX + "]?[\\p{Alnum}\\.\\-]+";
Preconditions.checkArgument... | java | public static String validateStreamName(String name) {
Preconditions.checkNotNull(name);
// In addition to user stream names, pravega internally created stream have a special prefix.
final String matcher = "[" + INTERNAL_NAME_PREFIX + "]?[\\p{Alnum}\\.\\-]+";
Preconditions.checkArgument... | [
"public",
"static",
"String",
"validateStreamName",
"(",
"String",
"name",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"name",
")",
";",
"// In addition to user stream names, pravega internally created stream have a special prefix.",
"final",
"String",
"matcher",
"="... | Validates an internal stream name.
@param name Stream name to validate.
@return The name in the case is valid. | [
"Validates",
"an",
"internal",
"stream",
"name",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/NameUtils.java#L67-L74 |
132,089 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/attributes/ContainerAttributeIndexImpl.java | ContainerAttributeIndexImpl.forSegment | @Override
public CompletableFuture<AttributeIndex> forSegment(long streamSegmentId, Duration timeout) {
Exceptions.checkNotClosed(this.closed.get(), this);
SegmentMetadata sm = this.containerMetadata.getStreamSegmentMetadata(streamSegmentId);
if (sm.isDeleted()) {
return Futures.... | java | @Override
public CompletableFuture<AttributeIndex> forSegment(long streamSegmentId, Duration timeout) {
Exceptions.checkNotClosed(this.closed.get(), this);
SegmentMetadata sm = this.containerMetadata.getStreamSegmentMetadata(streamSegmentId);
if (sm.isDeleted()) {
return Futures.... | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"AttributeIndex",
">",
"forSegment",
"(",
"long",
"streamSegmentId",
",",
"Duration",
"timeout",
")",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"this",
".",
"closed",
".",
"get",
"(",
")",
",",
"this",
... | region ContainerAttributeIndex Implementation | [
"region",
"ContainerAttributeIndex",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/attributes/ContainerAttributeIndexImpl.java#L96-L141 |
132,090 | pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableBucketReader.java | TableBucketReader.find | CompletableFuture<ResultT> find(ArrayView soughtKey, long bucketOffset, TimeoutTimer timer) {
int maxReadLength = getMaxReadLength();
// Read the Key at the current offset and check it against the sought one.
AtomicLong offset = new AtomicLong(bucketOffset);
CompletableFuture<ResultT> r... | java | CompletableFuture<ResultT> find(ArrayView soughtKey, long bucketOffset, TimeoutTimer timer) {
int maxReadLength = getMaxReadLength();
// Read the Key at the current offset and check it against the sought one.
AtomicLong offset = new AtomicLong(bucketOffset);
CompletableFuture<ResultT> r... | [
"CompletableFuture",
"<",
"ResultT",
">",
"find",
"(",
"ArrayView",
"soughtKey",
",",
"long",
"bucketOffset",
",",
"TimeoutTimer",
"timer",
")",
"{",
"int",
"maxReadLength",
"=",
"getMaxReadLength",
"(",
")",
";",
"// Read the Key at the current offset and check it agai... | Attempts to locate something in a TableBucket that matches a particular key.
@param soughtKey An {@link ArrayView} instance representing the Key we are looking for.
@param bucketOffset The current segment offset of the Table Bucket we are looking into.
@param timer A {@link TimeoutTimer} for the operation.
@... | [
"Attempts",
"to",
"locate",
"something",
"in",
"a",
"TableBucket",
"that",
"matches",
"a",
"particular",
"key",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/TableBucketReader.java#L149-L191 |
132,091 | pravega/pravega | common/src/main/java/io/pravega/common/io/EnhancedByteArrayOutputStream.java | EnhancedByteArrayOutputStream.write | @Override
public void write(int byteValue, int streamPosition) {
Preconditions.checkElementIndex(streamPosition, this.buf.length, "streamPosition");
this.buf[streamPosition] = (byte) byteValue;
} | java | @Override
public void write(int byteValue, int streamPosition) {
Preconditions.checkElementIndex(streamPosition, this.buf.length, "streamPosition");
this.buf[streamPosition] = (byte) byteValue;
} | [
"@",
"Override",
"public",
"void",
"write",
"(",
"int",
"byteValue",
",",
"int",
"streamPosition",
")",
"{",
"Preconditions",
".",
"checkElementIndex",
"(",
"streamPosition",
",",
"this",
".",
"buf",
".",
"length",
",",
"\"streamPosition\"",
")",
";",
"this",
... | region RandomAccessOutputStream Implementation | [
"region",
"RandomAccessOutputStream",
"Implementation"
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/EnhancedByteArrayOutputStream.java#L38-L42 |
132,092 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.createStream | @Task(name = "createStream", version = "1.0", resource = "{scope}/{stream}")
public CompletableFuture<CreateStreamStatus.Status> createStream(String scope, String stream, StreamConfiguration config, long createTimestamp) {
return execute(
new Resource(scope, stream),
new Seri... | java | @Task(name = "createStream", version = "1.0", resource = "{scope}/{stream}")
public CompletableFuture<CreateStreamStatus.Status> createStream(String scope, String stream, StreamConfiguration config, long createTimestamp) {
return execute(
new Resource(scope, stream),
new Seri... | [
"@",
"Task",
"(",
"name",
"=",
"\"createStream\"",
",",
"version",
"=",
"\"1.0\"",
",",
"resource",
"=",
"\"{scope}/{stream}\"",
")",
"public",
"CompletableFuture",
"<",
"CreateStreamStatus",
".",
"Status",
">",
"createStream",
"(",
"String",
"scope",
",",
"Stri... | Create stream.
@param scope scope.
@param stream stream name.
@param config stream configuration.
@param createTimestamp creation timestamp.
@return creation status. | [
"Create",
"stream",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L155-L161 |
132,093 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.updateStream | public CompletableFuture<UpdateStreamStatus.Status> updateStream(String scope, String stream, StreamConfiguration newConfig,
OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext... | java | public CompletableFuture<UpdateStreamStatus.Status> updateStream(String scope, String stream, StreamConfiguration newConfig,
OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext... | [
"public",
"CompletableFuture",
"<",
"UpdateStreamStatus",
".",
"Status",
">",
"updateStream",
"(",
"String",
"scope",
",",
"String",
"stream",
",",
"StreamConfiguration",
"newConfig",
",",
"OperationContext",
"contextOpt",
")",
"{",
"final",
"OperationContext",
"conte... | Update stream's configuration.
@param scope scope.
@param stream stream name.
@param newConfig modified stream configuration.
@param contextOpt optional context
@return update status. | [
"Update",
"stream",
"s",
"configuration",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L172-L201 |
132,094 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.generateStreamCut | public CompletableFuture<StreamCutRecord> generateStreamCut(final String scope, final String stream, final StreamCutRecord previous,
final OperationContext contextOpt, String delegationToken) {
final OperationContext context = contextOpt == null ? ... | java | public CompletableFuture<StreamCutRecord> generateStreamCut(final String scope, final String stream, final StreamCutRecord previous,
final OperationContext contextOpt, String delegationToken) {
final OperationContext context = contextOpt == null ? ... | [
"public",
"CompletableFuture",
"<",
"StreamCutRecord",
">",
"generateStreamCut",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"StreamCutRecord",
"previous",
",",
"final",
"OperationContext",
"contextOpt",
",",
"String",
"delegationT... | Generate a new stream cut.
@param scope scope.
@param stream stream name.
@param contextOpt optional context
@param delegationToken token to be sent to segmentstore.
@param previous previous stream cut record
@return streamCut. | [
"Generate",
"a",
"new",
"stream",
"cut",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L336-L353 |
132,095 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.truncateStream | public CompletableFuture<UpdateStreamStatus.Status> truncateStream(final String scope, final String stream,
final Map<Long, Long> streamCut,
final OperationContext contextOpt) {
... | java | public CompletableFuture<UpdateStreamStatus.Status> truncateStream(final String scope, final String stream,
final Map<Long, Long> streamCut,
final OperationContext contextOpt) {
... | [
"public",
"CompletableFuture",
"<",
"UpdateStreamStatus",
".",
"Status",
">",
"truncateStream",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"Map",
"<",
"Long",
",",
"Long",
">",
"streamCut",
",",
"final",
"OperationContext",
... | Truncate a stream.
@param scope scope.
@param stream stream name.
@param streamCut stream cut.
@param contextOpt optional context
@return update status. | [
"Truncate",
"a",
"stream",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L364-L386 |
132,096 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.sealStream | public CompletableFuture<UpdateStreamStatus.Status> sealStream(String scope, String stream, OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, stream) : contextOpt;
final long requestId = requestTracker.getRequestIdFor("sealStrea... | java | public CompletableFuture<UpdateStreamStatus.Status> sealStream(String scope, String stream, OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, stream) : contextOpt;
final long requestId = requestTracker.getRequestIdFor("sealStrea... | [
"public",
"CompletableFuture",
"<",
"UpdateStreamStatus",
".",
"Status",
">",
"sealStream",
"(",
"String",
"scope",
",",
"String",
"stream",
",",
"OperationContext",
"contextOpt",
")",
"{",
"final",
"OperationContext",
"context",
"=",
"contextOpt",
"==",
"null",
"... | Seal a stream.
@param scope scope.
@param stream stream name.
@param contextOpt optional context
@return update status. | [
"Seal",
"a",
"stream",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L440-L469 |
132,097 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.deleteStream | public CompletableFuture<DeleteStreamStatus.Status> deleteStream(final String scope, final String stream,
final OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, strea... | java | public CompletableFuture<DeleteStreamStatus.Status> deleteStream(final String scope, final String stream,
final OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, strea... | [
"public",
"CompletableFuture",
"<",
"DeleteStreamStatus",
".",
"Status",
">",
"deleteStream",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"OperationContext",
"contextOpt",
")",
"{",
"final",
"OperationContext",
"context",
"=",
... | Delete a stream. Precondition for deleting a stream is that the stream sholud be sealed.
@param scope scope.
@param stream stream name.
@param contextOpt optional context
@return delete status. | [
"Delete",
"a",
"stream",
".",
"Precondition",
"for",
"deleting",
"a",
"stream",
"is",
"that",
"the",
"stream",
"sholud",
"be",
"sealed",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L484-L512 |
132,098 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.manualScale | public CompletableFuture<ScaleResponse> manualScale(String scope, String stream, List<Long> segmentsToSeal,
List<Map.Entry<Double, Double>> newRanges, long scaleTimestamp,
OperationContext context) {
... | java | public CompletableFuture<ScaleResponse> manualScale(String scope, String stream, List<Long> segmentsToSeal,
List<Map.Entry<Double, Double>> newRanges, long scaleTimestamp,
OperationContext context) {
... | [
"public",
"CompletableFuture",
"<",
"ScaleResponse",
">",
"manualScale",
"(",
"String",
"scope",
",",
"String",
"stream",
",",
"List",
"<",
"Long",
">",
"segmentsToSeal",
",",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Double",
">",
">",
"newRa... | Helper method to perform scale operation against an scale request.
This method posts a request in the request stream and then starts the scale operation while
tracking it's progress. Eventually, after scale completion, it sends a response to the caller.
@param scope scope.
@param stream stream name.
@... | [
"Helper",
"method",
"to",
"perform",
"scale",
"operation",
"against",
"an",
"scale",
"request",
".",
"This",
"method",
"posts",
"a",
"request",
"in",
"the",
"request",
"stream",
"and",
"then",
"starts",
"the",
"scale",
"operation",
"while",
"tracking",
"it",
... | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L532-L564 |
132,099 | pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.checkScale | public CompletableFuture<ScaleStatusResponse> checkScale(String scope, String stream, int epoch,
OperationContext context) {
CompletableFuture<EpochRecord> activeEpochFuture =
streamMetadataStore.getActiveEpoch(scope, stream... | java | public CompletableFuture<ScaleStatusResponse> checkScale(String scope, String stream, int epoch,
OperationContext context) {
CompletableFuture<EpochRecord> activeEpochFuture =
streamMetadataStore.getActiveEpoch(scope, stream... | [
"public",
"CompletableFuture",
"<",
"ScaleStatusResponse",
">",
"checkScale",
"(",
"String",
"scope",
",",
"String",
"stream",
",",
"int",
"epoch",
",",
"OperationContext",
"context",
")",
"{",
"CompletableFuture",
"<",
"EpochRecord",
">",
"activeEpochFuture",
"=",
... | Helper method to check if scale operation against an epoch completed or not.
@param scope scope.
@param stream stream name.
@param epoch stream epoch.
@param context optional context
@return returns the newly created segments. | [
"Helper",
"method",
"to",
"check",
"if",
"scale",
"operation",
"against",
"an",
"epoch",
"completed",
"or",
"not",
"."
] | 6e24df7470669b3956a07018f52b2c6b3c2a3503 | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L575-L615 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.