Interface Ample

  • All Known Implementing Classes:
    AmpleImpl

    public interface Ample
    Accumulo Metadata Persistence Layer. Entry point and abstractions layer for reading and updating persisted Accumulo metadata. This metadata may be stored in Zookeeper or in Accumulo system tables.

    This interface seeks to satisfy the following goals.

    • Provide a single entry point for all reading and writing of Accumulo Metadata.
    • The root tablet persists its data in Zookeeper. Metadata tablets persist their data in root tablet. All other tablets persist their data in the metadata table. This interface abstracts how and where information for a tablet is actually persisted.
    • Before the creation of this interface, many concurrent metadata table updates resulted in separate synchronous RPCs. The design of this interface allows batching of metadata table updates within a tablet server for cluster wide efficiencies. Batching is not required by implementations, but the design of the interface makes it possible.
    • Make code that updates Accumulo persistent metadata more concise. Before this interface existed, there was a lot of redundant and verbose code for updating metadata.
    • Reduce specialized code for the root tablet. Currently there is specialized code to manage the root tablets files that is different from all other tablets. This interface is the beginning of an effort to remove this specialized code. See #936
    • Method Detail

      • readTablet

        default TabletMetadata readTablet​(KeyExtent extent,
                                          TabletMetadata.ColumnType... colsToFetch)
        Read a single tablets metadata. No checking is done for prev row, so it could differ. The method will read the data using Ample.ReadConsistency.IMMEDIATE.
        Parameters:
        extent - Reads tablet metadata using the table id and end row from this extent.
        colsToFetch - What tablets columns to fetch. If empty, then everything is fetched.
      • readTablet

        TabletMetadata readTablet​(KeyExtent extent,
                                  Ample.ReadConsistency readConsistency,
                                  TabletMetadata.ColumnType... colsToFetch)
        Read a single tablets metadata. No checking is done for prev row, so it could differ.
        Parameters:
        extent - Reads tablet metadata using the table id and end row from this extent.
        readConsistency - Controls how the data is read.
        colsToFetch - What tablets columns to fetch. If empty, then everything is fetched.
      • readTablets

        TabletsMetadata.TableOptions readTablets()
        Entry point for reading multiple tablets' metadata. Generates a TabletsMetadata builder object and assigns the AmpleImpl client to that builder object. This allows readTablets() to be called from a ClientContext. Associated methods of the TabletsMetadata Builder class are used to generate the metadata.
      • mutateTablet

        default Ample.TabletMutator mutateTablet​(KeyExtent extent)
        Initiates mutating a single tablets persistent metadata. No data is persisted until the mutate() method is called on the returned object. If updating multiple tablets, consider using mutateTablets()
        Parameters:
        extent - Mutates a tablet that has this table id and end row. The prev end row is not considered or checked.
      • mutateTablets

        default Ample.TabletsMutator mutateTablets()
        Use this when updating multiple tablets. Ensure the returns TabletsMutator is closed, or data may not be persisted.
      • createDeleteMutation

        default Mutation createDeleteMutation​(ReferenceFile tabletFilePathToRemove)
        Return an encoded delete marker Mutation to delete the specified TabletFile path. A ReferenceFile is used for the parameter because the Garbage Collector is optimized to store a directory for Tablet File. Otherwise, a TabletFile object could be used. The tabletFilePathToRemove is validated and normalized before creating the mutation.
        Parameters:
        tabletFilePathToRemove - String full path of the TabletFile
        Returns:
        Mutation with encoded delete marker
      • putScanServerFileReferences

        default void putScanServerFileReferences​(Collection<ScanServerRefTabletFile> scanRefs)
        Insert ScanServer references to Tablet files
        Parameters:
        scanRefs - set of scan server ref table file objects
      • getScanServerFileReferences

        default Stream<ScanServerRefTabletFile> getScanServerFileReferences()
        Get ScanServer references to Tablet files
        Returns:
        stream of scan server references
      • deleteScanServerFileReferences

        default void deleteScanServerFileReferences​(Collection<ScanServerRefTabletFile> refsToDelete)
        Delete the set of scan server references
        Parameters:
        refsToDelete - set of scan server references to delete
      • deleteScanServerFileReferences

        default void deleteScanServerFileReferences​(String serverAddress,
                                                    UUID serverSessionId)
        Delete scan server references for this server
        Parameters:
        serverAddress - address of server, cannot be null
        serverSessionId - server session id, cannot be null