Interface Controller

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    ControllerImpl

    public interface Controller
    extends java.lang.AutoCloseable
    Stream Controller APIs.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Void> abortTransaction​(Stream stream, java.util.UUID txId)
      Aborts a transaction.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> checkScaleStatus​(Stream stream, int scaleEpoch)
      API to check the status of scale for a given epoch.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> checkScopeExists​(java.lang.String scopeName)
      Check if scope exists.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> checkStreamExists​(java.lang.String scopeName, java.lang.String streamName)
      Check if stream exists.
      java.util.concurrent.CompletableFuture<Transaction.Status> checkTransactionStatus​(Stream stream, java.util.UUID txId)
      Returns the status of the specified transaction.
      void close()
      Closes controller client.
      java.util.concurrent.CompletableFuture<java.lang.Void> commitTransaction​(Stream stream, java.lang.String writerId, java.lang.Long timestamp, java.util.UUID txId)
      Commits a transaction, atomically committing all events to the stream, subject to the ordering guarantees specified in EventStreamWriter.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> createKeyValueTable​(java.lang.String scope, java.lang.String kvtName, KeyValueTableConfiguration kvtConfig)
      API to create a KeyValueTable.
      java.util.concurrent.CompletableFuture<ReaderGroupConfig> createReaderGroup​(java.lang.String scopeName, java.lang.String rgName, ReaderGroupConfig config)
      API create a ReaderGroup.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> createScope​(java.lang.String scopeName)
      API to create a scope.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> createStream​(java.lang.String scope, java.lang.String streamName, StreamConfiguration streamConfig)
      API to create a stream.
      java.util.concurrent.CompletableFuture<TxnSegments> createTransaction​(Stream stream, long lease)
      API to create a new transaction.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteKeyValueTable​(java.lang.String scope, java.lang.String kvtName)
      API to delete a KeyValueTable.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteReaderGroup​(java.lang.String scope, java.lang.String rgName, java.util.UUID readerGroupId)
      API to delete a Reader Group.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteScope​(java.lang.String scopeName)
      API to delete a scope.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteStream​(java.lang.String scope, java.lang.String streamName)
      API to delete a stream.
      java.util.concurrent.CompletableFuture<StreamSegments> getCurrentSegments​(java.lang.String scope, java.lang.String streamName)
      API to get list of current segments for the stream to write to.
      java.util.concurrent.CompletableFuture<KeyValueTableSegments> getCurrentSegmentsForKeyValueTable​(java.lang.String scope, java.lang.String kvtName)
      API to get list of current segments for the KeyValueTable to write to.
      java.util.concurrent.CompletableFuture<io.pravega.shared.protocol.netty.PravegaNodeUri> getEndpointForSegment​(java.lang.String qualifiedSegmentName)
      Given a segment return the endpoint that currently is the owner of that segment.
      java.util.concurrent.CompletableFuture<StreamSegments> getEpochSegments​(java.lang.String scope, java.lang.String streamName, int epoch)
      API to get list of segments for given epoch.
      java.util.concurrent.CompletableFuture<java.lang.String> getOrRefreshDelegationTokenFor​(java.lang.String scope, java.lang.String streamName, io.pravega.shared.security.auth.AccessOperation accessOperation)
      Obtains a delegation token from the server.
      java.util.concurrent.CompletableFuture<ReaderGroupConfig> getReaderGroupConfig​(java.lang.String scope, java.lang.String rgName)
      API to get Reader Group Configuration.
      java.util.concurrent.CompletableFuture<StreamSegmentSuccessors> getSegments​(StreamCut fromStreamCut, StreamCut toStreamCut)
      Returns all the segments from the fromStreamCut till toStreamCut.
      java.util.concurrent.CompletableFuture<java.util.Map<Segment,​java.lang.Long>> getSegmentsAtTime​(Stream stream, long timestamp)
      Given a timestamp and a stream returns segments and offsets that were present at that time in the stream.
      java.util.concurrent.CompletableFuture<StreamSegmentsWithPredecessors> getSuccessors​(Segment segment)
      Returns StreamSegmentsWithPredecessors containing each of the segments that are successors to the segment requested mapped to a list of their predecessors.
      java.util.concurrent.CompletableFuture<StreamSegmentSuccessors> getSuccessors​(StreamCut from)
      Returns all the segments that come after the provided cutpoint.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> isSegmentOpen​(Segment segment)
      Checks to see if a segment exists and is not sealed.
      io.pravega.common.util.AsyncIterator<KeyValueTableInfo> listKeyValueTables​(java.lang.String scopeName)
      Gets an AsyncIterator on KeyValueTables in scope.
      io.pravega.common.util.AsyncIterator<java.lang.String> listScopes()
      Gets an async iterator on scopes.
      io.pravega.common.util.AsyncIterator<Stream> listStreams​(java.lang.String scopeName)
      Gets an async iterator on streams in scope.
      java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> listSubscribers​(java.lang.String scope, java.lang.String streamName)
      Get list of Subscribers for the Stream.
      java.util.concurrent.CompletableFuture<java.lang.Void> noteTimestampFromWriter​(java.lang.String writer, Stream stream, long timestamp, WriterPosition lastWrittenPosition)
      Notifies that the specified writer has noted the provided timestamp when it was at lastWrittenPosition.
      java.util.concurrent.CompletableFuture<Transaction.PingStatus> pingTransaction​(Stream stream, java.util.UUID txId, long lease)
      API to send transaction heartbeat and increase the transaction timeout by lease amount of milliseconds.
      java.util.concurrent.CompletableFuture<java.lang.Void> removeWriter​(java.lang.String writerId, Stream stream)
      Notifies the controller that the specified writer is shutting down gracefully and no longer needs to be considered for calculating entries for the marks segment.
      CancellableRequest<java.lang.Boolean> scaleStream​(Stream stream, java.util.List<java.lang.Long> sealedSegments, java.util.Map<java.lang.Double,​java.lang.Double> newKeyRanges, java.util.concurrent.ScheduledExecutorService executorService)
      API to merge or split stream segments.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> sealStream​(java.lang.String scope, java.lang.String streamName)
      API to seal a stream.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> startScale​(Stream stream, java.util.List<java.lang.Long> sealedSegments, java.util.Map<java.lang.Double,​java.lang.Double> newKeyRanges)
      API to request start of scale operation on controller.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> truncateStream​(java.lang.String scope, java.lang.String streamName, StreamCut streamCut)
      API to Truncate stream.
      java.util.concurrent.CompletableFuture<java.lang.Long> updateReaderGroup​(java.lang.String scopeName, java.lang.String rgName, ReaderGroupConfig config)
      API to update a ReaderGroup config.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> updateStream​(java.lang.String scope, java.lang.String streamName, StreamConfiguration streamConfig)
      API to update the configuration of a stream.
      java.util.concurrent.CompletableFuture<java.lang.Boolean> updateSubscriberStreamCut​(java.lang.String scope, java.lang.String streamName, java.lang.String subscriber, java.util.UUID readerGroupId, long generation, StreamCut streamCut)
      API to update the truncation StreamCut for a particular Subscriber on Controller.
    • Method Detail

      • checkScopeExists

        java.util.concurrent.CompletableFuture<java.lang.Boolean> checkScopeExists​(java.lang.String scopeName)
        Check if scope exists.
        Parameters:
        scopeName - name of scope.
        Returns:
        CompletableFuture which when completed will indicate if scope exists or not.
      • listScopes

        io.pravega.common.util.AsyncIterator<java.lang.String> listScopes()
        Gets an async iterator on scopes.
        Returns:
        An AsyncIterator which can be used to iterate over all scopes.
      • createScope

        java.util.concurrent.CompletableFuture<java.lang.Boolean> createScope​(java.lang.String scopeName)
        API to create a scope. The future completes with true in the case the scope did not exist when the controller executed the operation. In the case of a re-attempt to create the same scope, the future completes with false to indicate that the scope existed when the controller executed the operation.
        Parameters:
        scopeName - Scope name.
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the scope was added because it did not already exist.
      • listStreams

        io.pravega.common.util.AsyncIterator<Stream> listStreams​(java.lang.String scopeName)
        Gets an async iterator on streams in scope.
        Parameters:
        scopeName - The name of the scope for which to list streams in.
        Returns:
        An AsyncIterator which can be used to iterate over all Streams in the scope.
      • deleteScope

        java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteScope​(java.lang.String scopeName)
        API to delete a scope. Note that a scope can only be deleted in the case is it empty. If the scope contains at least one stream, then the delete request will fail.
        Parameters:
        scopeName - Scope name.
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the scope was removed because it existed.
      • createStream

        java.util.concurrent.CompletableFuture<java.lang.Boolean> createStream​(java.lang.String scope,
                                                                               java.lang.String streamName,
                                                                               StreamConfiguration streamConfig)
        API to create a stream. The future completes with true in the case the stream did not exist when the controller executed the operation. In the case of a re-attempt to create the same stream, the future completes with false to indicate that the stream existed when the controller executed the operation.
        Parameters:
        scope - Scope
        streamName - Stream name
        streamConfig - Stream configuration
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the stream was added because it did not already exist.
      • checkStreamExists

        java.util.concurrent.CompletableFuture<java.lang.Boolean> checkStreamExists​(java.lang.String scopeName,
                                                                                    java.lang.String streamName)
        Check if stream exists.
        Parameters:
        scopeName - name of scope.
        streamName - name of stream.
        Returns:
        CompletableFuture which when completed will indicate if stream exists or not.
      • updateStream

        java.util.concurrent.CompletableFuture<java.lang.Boolean> updateStream​(java.lang.String scope,
                                                                               java.lang.String streamName,
                                                                               StreamConfiguration streamConfig)
        API to update the configuration of a stream.
        Parameters:
        scope - Scope
        streamName - Stream name
        streamConfig - Stream configuration to updated
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the stream was updated because the config is now different from before.
      • createReaderGroup

        java.util.concurrent.CompletableFuture<ReaderGroupConfig> createReaderGroup​(java.lang.String scopeName,
                                                                                    java.lang.String rgName,
                                                                                    ReaderGroupConfig config)
        API create a ReaderGroup.
        Parameters:
        scopeName - Scope name for Reader Group.
        rgName - Stream name.
        config - ReaderGroup confguration.
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the subscriber was updated in Stream Metadata.
        Throws:
        java.lang.IllegalArgumentException - if Stream does not exist.
      • updateReaderGroup

        java.util.concurrent.CompletableFuture<java.lang.Long> updateReaderGroup​(java.lang.String scopeName,
                                                                                 java.lang.String rgName,
                                                                                 ReaderGroupConfig config)
        API to update a ReaderGroup config.
        Parameters:
        scopeName - Scope name for Reader Group.
        rgName - Stream name.
        config - ReaderGroup configuration.
        Returns:
        A future which will throw if the operation fails, otherwise the subscriber was updated in Stream Metadata and a long indicating the updated config generation is returned.
        Throws:
        java.lang.IllegalArgumentException - if Stream does not exist.
        ReaderGroupConfigRejectedException - if the provided ReaderGroupConfig is invalid
      • getReaderGroupConfig

        java.util.concurrent.CompletableFuture<ReaderGroupConfig> getReaderGroupConfig​(java.lang.String scope,
                                                                                       java.lang.String rgName)
        API to get Reader Group Configuration.
        Parameters:
        scope - Scope name for Reader Group.
        rgName - Stream name.
        Returns:
        A future which will throw if the operation fails, otherwise returns configuration of the Reader Group.
        Throws:
        java.lang.IllegalArgumentException - if ReaderGroup does not exist.
      • deleteReaderGroup

        java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteReaderGroup​(java.lang.String scope,
                                                                                    java.lang.String rgName,
                                                                                    java.util.UUID readerGroupId)
        API to delete a Reader Group.
        Parameters:
        scope - Scope name for Reader Group.
        rgName - Reader Group name.
        readerGroupId - Unique Id for this readerGroup.
        Returns:
        A future which will throw if the operation fails, otherwise returns configuration of the Reader Group.
      • listSubscribers

        java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> listSubscribers​(java.lang.String scope,
                                                                                                 java.lang.String streamName)
        Get list of Subscribers for the Stream.
        Parameters:
        scope - Scope name
        streamName - Stream name
        Returns:
        List of StreamSubscribers.
      • updateSubscriberStreamCut

        java.util.concurrent.CompletableFuture<java.lang.Boolean> updateSubscriberStreamCut​(java.lang.String scope,
                                                                                            java.lang.String streamName,
                                                                                            java.lang.String subscriber,
                                                                                            java.util.UUID readerGroupId,
                                                                                            long generation,
                                                                                            StreamCut streamCut)
        API to update the truncation StreamCut for a particular Subscriber on Controller. Used when Stream has Consumption Based Retention Policy configured.
        Parameters:
        scope - Scope name
        streamName - Stream name
        subscriber - Name/Id that uniquely identifies a Stream Subscriber.
        readerGroupId - Reader Group Id.
        generation - subscriber generation number.
        streamCut - StreamCut at which Stream can be Truncated for a Consumption based retention policy
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the subscribers position was updated in Stream Metadata.
        Throws:
        java.lang.IllegalArgumentException - if Stream/Subscriber does not exist, or StreamCut is not valid.
      • truncateStream

        java.util.concurrent.CompletableFuture<java.lang.Boolean> truncateStream​(java.lang.String scope,
                                                                                 java.lang.String streamName,
                                                                                 StreamCut streamCut)
        API to Truncate stream. This api takes a stream cut point which corresponds to a cut in the stream segments which is consistent and covers the entire key range space.
        Parameters:
        scope - Scope
        streamName - Stream
        streamCut - Stream cut to updated
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the stream was truncated at the supplied cut.
      • sealStream

        java.util.concurrent.CompletableFuture<java.lang.Boolean> sealStream​(java.lang.String scope,
                                                                             java.lang.String streamName)
        API to seal a stream.
        Parameters:
        scope - Scope
        streamName - Stream name
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the stream was sealed because it was not previously.
      • deleteStream

        java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteStream​(java.lang.String scope,
                                                                               java.lang.String streamName)
        API to delete a stream. Only a sealed stream can be deleted.
        Parameters:
        scope - Scope name.
        streamName - Stream name.
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the stream was removed because it existed.
      • startScale

        java.util.concurrent.CompletableFuture<java.lang.Boolean> startScale​(Stream stream,
                                                                             java.util.List<java.lang.Long> sealedSegments,
                                                                             java.util.Map<java.lang.Double,​java.lang.Double> newKeyRanges)
        API to request start of scale operation on controller. This method returns a future that will complete when controller service accepts the scale request.
        Parameters:
        stream - Stream object.
        sealedSegments - List of segments to be sealed.
        newKeyRanges - Key ranges after scaling the stream.
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the scaling was started or not.
      • scaleStream

        CancellableRequest<java.lang.Boolean> scaleStream​(Stream stream,
                                                          java.util.List<java.lang.Long> sealedSegments,
                                                          java.util.Map<java.lang.Double,​java.lang.Double> newKeyRanges,
                                                          java.util.concurrent.ScheduledExecutorService executorService)
        API to merge or split stream segments. This call returns a future that completes when either the scale operation is completed on controller service (succeeded or failed) or the specified timeout elapses.
        Parameters:
        stream - Stream object.
        sealedSegments - List of segments to be sealed.
        newKeyRanges - Key ranges after scaling the stream.
        executorService - executor to be used for busy waiting.
        Returns:
        A Cancellable request object which can be used to get the future for scale operation or cancel the scale operation.
      • checkScaleStatus

        java.util.concurrent.CompletableFuture<java.lang.Boolean> checkScaleStatus​(Stream stream,
                                                                                   int scaleEpoch)
        API to check the status of scale for a given epoch.
        Parameters:
        stream - Stream object.
        scaleEpoch - stream's epoch for which the scale was started.
        Returns:
        True if scale completed, false otherwise.
      • getCurrentSegments

        java.util.concurrent.CompletableFuture<StreamSegments> getCurrentSegments​(java.lang.String scope,
                                                                                  java.lang.String streamName)
        API to get list of current segments for the stream to write to.
        Parameters:
        scope - Scope
        streamName - Stream name
        Returns:
        Current stream segments.
      • getEpochSegments

        java.util.concurrent.CompletableFuture<StreamSegments> getEpochSegments​(java.lang.String scope,
                                                                                java.lang.String streamName,
                                                                                int epoch)
        API to get list of segments for given epoch.
        Parameters:
        scope - Scope
        streamName - Stream name
        epoch - Epoch number.
        Returns:
        Stream segments for a given Epoch.
      • createTransaction

        java.util.concurrent.CompletableFuture<TxnSegments> createTransaction​(Stream stream,
                                                                              long lease)
        API to create a new transaction. The transaction timeout is relative to the creation time.
        Parameters:
        stream - Stream name
        lease - Time for which transaction shall remain open with sending any heartbeat.
        Returns:
        Transaction id.
      • pingTransaction

        java.util.concurrent.CompletableFuture<Transaction.PingStatus> pingTransaction​(Stream stream,
                                                                                       java.util.UUID txId,
                                                                                       long lease)
        API to send transaction heartbeat and increase the transaction timeout by lease amount of milliseconds.
        Parameters:
        stream - Stream name
        txId - Transaction id
        lease - Time for which transaction shall remain open with sending any heartbeat.
        Returns:
        Transaction.PingStatus or PingFailedException
      • commitTransaction

        java.util.concurrent.CompletableFuture<java.lang.Void> commitTransaction​(Stream stream,
                                                                                 java.lang.String writerId,
                                                                                 java.lang.Long timestamp,
                                                                                 java.util.UUID txId)
        Commits a transaction, atomically committing all events to the stream, subject to the ordering guarantees specified in EventStreamWriter. Will fail with TxnFailedException if the transaction has already been committed or aborted.
        Parameters:
        stream - Stream name
        writerId - The writer that is comiting the transaction.
        timestamp - The timestamp the writer provided for the commit (or null if they did not specify one).
        txId - Transaction id
        Returns:
        Void or TxnFailedException
      • abortTransaction

        java.util.concurrent.CompletableFuture<java.lang.Void> abortTransaction​(Stream stream,
                                                                                java.util.UUID txId)
        Aborts a transaction. No events written to it may be read, and no further events may be written. Will fail with TxnFailedException if the transaction has already been committed or aborted.
        Parameters:
        stream - Stream name
        txId - Transaction id
        Returns:
        Void or TxnFailedException
      • checkTransactionStatus

        java.util.concurrent.CompletableFuture<Transaction.Status> checkTransactionStatus​(Stream stream,
                                                                                          java.util.UUID txId)
        Returns the status of the specified transaction.
        Parameters:
        stream - Stream name
        txId - Transaction id
        Returns:
        Transaction status.
      • getSegmentsAtTime

        java.util.concurrent.CompletableFuture<java.util.Map<Segment,​java.lang.Long>> getSegmentsAtTime​(Stream stream,
                                                                                                              long timestamp)
        Given a timestamp and a stream returns segments and offsets that were present at that time in the stream.
        Parameters:
        stream - Name of the stream
        timestamp - Timestamp for getting segments
        Returns:
        A map of segments to the offset within them.
      • getSuccessors

        java.util.concurrent.CompletableFuture<StreamSegmentsWithPredecessors> getSuccessors​(Segment segment)
        Returns StreamSegmentsWithPredecessors containing each of the segments that are successors to the segment requested mapped to a list of their predecessors. In the event of a scale up the newly created segments contain a subset of the keyspace of the original segment and their only predecessor is the segment that was split. Example: If there are two segments A and B. A scaling event split A into two new segments C and D. The successors of A are C and D. So calling this method with A would return {C → A, D → A} In the event of a scale down there would be one segment the succeeds multiple. So it would contain the union of the keyspace of its predecessors. So calling with that segment would map to multiple segments. Example: If there are two segments A and B. A and B are merged into a segment C. The successor of A is C. so calling this method with A would return {C → {A, B}} If a segment has not been sealed, it may not have successors now even though it might in the future. The successors to a sealed segment are always known and returned. Example: If there is only one segment A and it is not sealed, and no scaling events have occurred calling this with a would return an empty map.
        Parameters:
        segment - The segment whose successors should be looked up.
        Returns:
        A mapping from Successor to the list of all of the Successor's predecessors
      • getSuccessors

        java.util.concurrent.CompletableFuture<StreamSegmentSuccessors> getSuccessors​(StreamCut from)
        Returns all the segments that come after the provided cutpoint.
        Parameters:
        from - The position from which to find the remaining bytes.
        Returns:
        The segments beyond a given cut position.
      • getSegments

        java.util.concurrent.CompletableFuture<StreamSegmentSuccessors> getSegments​(StreamCut fromStreamCut,
                                                                                    StreamCut toStreamCut)
        Returns all the segments from the fromStreamCut till toStreamCut.
        Parameters:
        fromStreamCut - From stream cut.
        toStreamCut - To stream cut.
        Returns:
        list of segments.
      • isSegmentOpen

        java.util.concurrent.CompletableFuture<java.lang.Boolean> isSegmentOpen​(Segment segment)
        Checks to see if a segment exists and is not sealed.
        Parameters:
        segment - The segment to verify.
        Returns:
        true if the segment exists and is open or false if it is not.
      • getEndpointForSegment

        java.util.concurrent.CompletableFuture<io.pravega.shared.protocol.netty.PravegaNodeUri> getEndpointForSegment​(java.lang.String qualifiedSegmentName)
        Given a segment return the endpoint that currently is the owner of that segment.

        This is called when a reader or a writer needs to determine which host/server it needs to contact to read and write, respectively. The result of this function can be cached until the endpoint is unreachable or indicates it is no longer the owner.

        Parameters:
        qualifiedSegmentName - The name of the segment. Usually obtained from Segment.getScopedName().
        Returns:
        Pravega node URI.
      • noteTimestampFromWriter

        java.util.concurrent.CompletableFuture<java.lang.Void> noteTimestampFromWriter​(java.lang.String writer,
                                                                                       Stream stream,
                                                                                       long timestamp,
                                                                                       WriterPosition lastWrittenPosition)
        Notifies that the specified writer has noted the provided timestamp when it was at lastWrittenPosition. This is called by writers via EventStreamWriter.noteTime(long) or Transaction.commit(long). The controller should aggrigate this information and write it to the stream's marks segment so that it read by readers who will in turn ultimately surface this information through the EventStreamReader.getCurrentTimeWindow(Stream) API.
        Parameters:
        writer - The name of the writer. (User defined)
        stream - The stream the timestamp is associated with.
        timestamp - The new timestamp for the writer on the stream.
        lastWrittenPosition - The position the writer was at when it noted the time.
      • removeWriter

        java.util.concurrent.CompletableFuture<java.lang.Void> removeWriter​(java.lang.String writerId,
                                                                            Stream stream)
        Notifies the controller that the specified writer is shutting down gracefully and no longer needs to be considered for calculating entries for the marks segment. This may not be called in the event that writer crashes.
        Parameters:
        writerId - The name of the writer. (User defined)
        stream - The stream the writer was on.
      • close

        void close()
        Closes controller client.
        Specified by:
        close in interface java.lang.AutoCloseable
        See Also:
        AutoCloseable.close()
      • getOrRefreshDelegationTokenFor

        java.util.concurrent.CompletableFuture<java.lang.String> getOrRefreshDelegationTokenFor​(java.lang.String scope,
                                                                                                java.lang.String streamName,
                                                                                                io.pravega.shared.security.auth.AccessOperation accessOperation)
        Obtains a delegation token from the server.
        Parameters:
        scope - Scope of the stream.
        streamName - Name of the stream.
        accessOperation - The requested permission.
        Returns:
        The delegation token for the given stream.
      • createKeyValueTable

        java.util.concurrent.CompletableFuture<java.lang.Boolean> createKeyValueTable​(java.lang.String scope,
                                                                                      java.lang.String kvtName,
                                                                                      KeyValueTableConfiguration kvtConfig)
        API to create a KeyValueTable. The future completes with true in the case the KeyValueTable did not exist when the controller executed the operation. In the case of a re-attempt to create the same KeyValueTable, the future completes with false to indicate that the KeyValueTable existed when the controller executed the operation.
        Parameters:
        scope - Scope
        kvtName - KeyValueTable name
        kvtConfig - The KeyValueTableConfiguration to create with.
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the stream was added because it did not already exist.
      • listKeyValueTables

        io.pravega.common.util.AsyncIterator<KeyValueTableInfo> listKeyValueTables​(java.lang.String scopeName)
        Gets an AsyncIterator on KeyValueTables in scope.
        Parameters:
        scopeName - The name of the scope for which to list KeyValueTables in.
        Returns:
        An AsyncIterator which can be used to iterate over all KeyValueTables in the scope.
      • deleteKeyValueTable

        java.util.concurrent.CompletableFuture<java.lang.Boolean> deleteKeyValueTable​(java.lang.String scope,
                                                                                      java.lang.String kvtName)
        API to delete a KeyValueTable. Only a sealed KeyValueTable can be deleted.
        Parameters:
        scope - Scope name.
        kvtName - KeyValueTable name.
        Returns:
        A future which will throw if the operation fails, otherwise returning a boolean to indicate that the KeyValueTable was removed because it existed.
      • getCurrentSegmentsForKeyValueTable

        java.util.concurrent.CompletableFuture<KeyValueTableSegments> getCurrentSegmentsForKeyValueTable​(java.lang.String scope,
                                                                                                         java.lang.String kvtName)
        API to get list of current segments for the KeyValueTable to write to.
        Parameters:
        scope - Scope
        kvtName - KeyValueTable name
        Returns:
        Current KeyValueTable segments.