Class MarlinAdminImpl

  • All Implemented Interfaces:
    Admin, java.lang.AutoCloseable

    public class MarlinAdminImpl
    extends com.mapr.fs.jni.MarlinJniAdmin
    implements Admin
    • Field Summary

      • Fields inherited from class com.mapr.fs.jni.MarlinJniClient

        _clntPtr
    • Constructor Summary

      Constructors 
      Constructor Description
      MarlinAdminImpl​(org.apache.hadoop.conf.Configuration conf)  
      MarlinAdminImpl​(org.apache.hadoop.conf.Configuration conf, java.lang.String clusterName)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.util.Map<org.apache.kafka.common.TopicPartition,​org.apache.kafka.common.protocol.Errors> alterConsumerGroupOffsets​(java.lang.String stream, java.lang.String groupId, java.util.Map<org.apache.kafka.common.TopicPartition,​org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets)
      Alter the consumer group offsets for group with group id.
      java.util.List<CursorInfo> alterCursors​(java.lang.String streamName, java.lang.String listenerGID, java.lang.String topicName, int feedId, long offset)  
      void close()
      Override AutoCloseable.close() to avoid declaring a checked exception.
      void close​(long duration, java.util.concurrent.TimeUnit unit)
      Deprecated.
      void close​(java.time.Duration timeout)  
      void compactTopicNow​(java.lang.String streamPath, java.lang.String topicName)  
      int countTopics​(java.lang.String streamName)
      Count the number of topics in a stream.
      void createStream​(java.lang.String streamName, StreamDescriptor gdesc)
      Create a stream.
      static void createStreamForCopy​(java.lang.String replicaStreamName, java.lang.String srcStreamName)  
      void createTopic​(java.lang.String streamPath, java.lang.String topicName)
      Create a topic with the default number of partitions.
      void createTopic​(java.lang.String streamPath, java.lang.String topicName, int nfeeds)
      Create a topic with the specified number of partitions.
      void createTopic​(java.lang.String streamPath, java.lang.String topicName, TopicDescriptor desc)
      Create a topic with the default number of partitions.
      void deleteCursors​(java.lang.String streamName, java.lang.String listenerGID, java.lang.String topicName, int feedId)  
      void deleteStream​(java.lang.String streamName)
      Delete a stream.
      void deleteTopic​(java.lang.String streamPath, java.lang.String topicName)
      Delete a topic.
      void editStream​(java.lang.String streamName, StreamDescriptor gdesc)
      Modify the attributes of a stream.
      void editTopic​(java.lang.String streamPath, java.lang.String topicName, int nfeeds)
      Modify the number of partitions for a topic.
      void editTopic​(java.lang.String streamPath, java.lang.String topicName, TopicDescriptor topicDesc)
      Create a topic with the default number of partitions.
      boolean FilterResult​(org.ojai.Document rec, java.lang.String streamName, java.lang.String listenerGID, java.lang.String topic, AssignInfo ai, java.util.Map<java.lang.String,​com.mapr.fs.proto.Marlinserver.MarlinTopicMetaEntry> topicMetaMap)  
      StreamDescriptor getStreamDescriptor​(java.lang.String streamName)
      Get the StreamDescriptor for a stream.
      TopicDescriptor getTopicDescriptor​(java.lang.String streamPath, java.lang.String topicName)  
      com.mapr.fs.proto.Marlinserver.MarlinTopicMetaEntry getTopicMetaEntry​(java.lang.String topicFullName)  
      java.util.List<TopicFeedInfo> infoTopic​(java.lang.String topicFullName)  
      java.util.List<TopicFeedInfo> infoTopicCommon​(java.lang.String topicFullName, boolean headOnly)  
      java.util.List<CursorInfo> listAllCursors​(java.lang.String streamName)  
      java.util.List<AssignInfo> listAssigns​(java.lang.String streamName, java.lang.String listenerGID, java.lang.String topicName)  
      java.util.Map<org.apache.kafka.common.TopicPartition,​org.apache.kafka.clients.consumer.OffsetAndMetadata> listConsumerGroupOffsets​(java.lang.String streamName, java.lang.String groupId)
      List all the consumer group offsets within a stream and group id.
      java.util.Collection<java.lang.Object> listConsumerGroups​(java.lang.String streamName)
      List all the consumer groups within a stream.
      java.util.List<CursorInfo> listCursors​(java.lang.String streamName, java.lang.String listenerGID, java.lang.String topicName, int feedId)  
      java.util.List<CursorInfo> listCursorsForTopic​(java.lang.String topicFullName)  
      java.util.List<java.lang.String> listTopics​(java.lang.String streamName)
      List all the topics within a stream.
      java.util.Map<java.lang.String,​java.util.List<TopicFeedInfo>> listTopicsForStream​(java.lang.String streamName)
      List all the topics within a stream.
      boolean streamExists​(java.lang.String streamPath)  
      • Methods inherited from class com.mapr.fs.jni.MarlinJniAdmin

        CloseAdmin, CompactTopic, CreateStream, CreateTopic, CreateTopicWithDefaultFeeds, DeleteTopic, EditTopic, GetTopicMetaEntry, OpenAdmin, StatFeedsOnTablet, StatTopicFeed
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MarlinAdminImpl

        public MarlinAdminImpl​(org.apache.hadoop.conf.Configuration conf)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • MarlinAdminImpl

        public MarlinAdminImpl​(org.apache.hadoop.conf.Configuration conf,
                               java.lang.String clusterName)
                        throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • createStream

        public void createStream​(java.lang.String streamName,
                                 StreamDescriptor gdesc)
                          throws java.io.IOException,
                                 java.lang.IllegalArgumentException
        Description copied from interface: Admin
        Create a stream.
        Specified by:
        createStream in interface Admin
        Parameters:
        streamName - absolute path of the stream in MapR-FS
        gdesc - descriptor for stream attributes
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • editStream

        public void editStream​(java.lang.String streamName,
                               StreamDescriptor gdesc)
                        throws java.io.IOException,
                               java.lang.IllegalArgumentException,
                               java.security.AccessControlException
        Description copied from interface: Admin
        Modify the attributes of a stream.
        Specified by:
        editStream in interface Admin
        Parameters:
        streamName - absolute path of the stream in MapR-FS
        gdesc - descriptor for stream attributes
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
        java.security.AccessControlException
      • getStreamDescriptor

        public StreamDescriptor getStreamDescriptor​(java.lang.String streamName)
                                             throws java.io.IOException,
                                                    java.lang.IllegalArgumentException
        Description copied from interface: Admin
        Get the StreamDescriptor for a stream.
        Specified by:
        getStreamDescriptor in interface Admin
        Parameters:
        streamName - absolute path of the stream in MapR-FS
        Returns:
        descriptor for stream attributes
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • createStreamForCopy

        public static void createStreamForCopy​(java.lang.String replicaStreamName,
                                               java.lang.String srcStreamName)
                                        throws java.io.IOException,
                                               java.lang.IllegalArgumentException
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • deleteStream

        public void deleteStream​(java.lang.String streamName)
                          throws java.io.IOException,
                                 java.lang.IllegalArgumentException
        Description copied from interface: Admin
        Delete a stream.
        Specified by:
        deleteStream in interface Admin
        Parameters:
        streamName - absolute path of the stream in MapR-FS
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • countTopics

        public int countTopics​(java.lang.String streamName)
                        throws java.io.IOException,
                               java.lang.IllegalArgumentException
        Description copied from interface: Admin
        Count the number of topics in a stream.
        Specified by:
        countTopics in interface Admin
        Parameters:
        streamName - absolute path of the stream in MapR-FS
        Returns:
        number of topics in the stream.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • streamExists

        public boolean streamExists​(java.lang.String streamPath)
                             throws java.io.IOException
        Specified by:
        streamExists in interface Admin
        Returns:
        true if the specified path exists and is a stream
        Throws:
        java.io.IOException
      • createTopic

        public void createTopic​(java.lang.String streamPath,
                                java.lang.String topicName)
                         throws java.io.IOException
        Description copied from interface: Admin
        Create a topic with the default number of partitions.
        Specified by:
        createTopic in interface Admin
        Parameters:
        streamPath - absolute path of the stream in MapR-FS
        topicName - name of the topic
        Throws:
        java.io.IOException
      • createTopic

        public void createTopic​(java.lang.String streamPath,
                                java.lang.String topicName,
                                int nfeeds)
                         throws java.io.IOException
        Description copied from interface: Admin
        Create a topic with the specified number of partitions.
        Specified by:
        createTopic in interface Admin
        Parameters:
        streamPath - absolute path of the stream in MapR-FS
        topicName - name of the topic
        Throws:
        java.io.IOException
      • createTopic

        public void createTopic​(java.lang.String streamPath,
                                java.lang.String topicName,
                                TopicDescriptor desc)
                         throws java.io.IOException
        Description copied from interface: Admin
        Create a topic with the default number of partitions.
        Specified by:
        createTopic in interface Admin
        Parameters:
        streamPath - absolute path of the stream in MapR-FS
        topicName - name of the topic
        desc - descriptor for topic attributes
        Throws:
        java.io.IOException
      • compactTopicNow

        public void compactTopicNow​(java.lang.String streamPath,
                                    java.lang.String topicName)
                             throws java.io.IOException
        Specified by:
        compactTopicNow in interface Admin
        Throws:
        java.io.IOException
      • editTopic

        public void editTopic​(java.lang.String streamPath,
                              java.lang.String topicName,
                              int nfeeds)
                       throws java.io.IOException
        Description copied from interface: Admin
        Modify the number of partitions for a topic.
        Specified by:
        editTopic in interface Admin
        Parameters:
        streamPath - absolute path of the stream in MapR-FS
        topicName - name of the topic
        Throws:
        java.io.IOException
      • editTopic

        public void editTopic​(java.lang.String streamPath,
                              java.lang.String topicName,
                              TopicDescriptor topicDesc)
                       throws java.io.IOException
        Description copied from interface: Admin
        Create a topic with the default number of partitions.
        Specified by:
        editTopic in interface Admin
        Parameters:
        streamPath - absolute path of the stream in MapR-FS
        topicName - name of the topic
        topicDesc - descriptor for topic attributes
        Throws:
        java.io.IOException
      • deleteTopic

        public void deleteTopic​(java.lang.String streamPath,
                                java.lang.String topicName)
                         throws java.io.IOException
        Description copied from interface: Admin
        Delete a topic.
        Specified by:
        deleteTopic in interface Admin
        Parameters:
        streamPath - absolute path of the stream in MapR-FS
        topicName - name of the topic
        Throws:
        java.io.IOException
      • getTopicDescriptor

        public TopicDescriptor getTopicDescriptor​(java.lang.String streamPath,
                                                  java.lang.String topicName)
                                           throws java.io.IOException
        Specified by:
        getTopicDescriptor in interface Admin
        Returns:
        descriptor for topic attributes
        Throws:
        java.io.IOException
      • getTopicMetaEntry

        public com.mapr.fs.proto.Marlinserver.MarlinTopicMetaEntry getTopicMetaEntry​(java.lang.String topicFullName)
                                                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • infoTopicCommon

        public java.util.List<TopicFeedInfo> infoTopicCommon​(java.lang.String topicFullName,
                                                             boolean headOnly)
                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • infoTopic

        public java.util.List<TopicFeedInfo> infoTopic​(java.lang.String topicFullName)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • listTopics

        public java.util.List<java.lang.String> listTopics​(java.lang.String streamName)
                                                    throws java.io.IOException,
                                                           java.lang.IllegalArgumentException
        Description copied from interface: Admin
        List all the topics within a stream.
        Specified by:
        listTopics in interface Admin
        Returns:
        list of topic names for the topics in the stream.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • listTopicsForStream

        public java.util.Map<java.lang.String,​java.util.List<TopicFeedInfo>> listTopicsForStream​(java.lang.String streamName)
                                                                                                throws java.io.IOException,
                                                                                                       java.lang.IllegalArgumentException
        Description copied from interface: Admin
        List all the topics within a stream.
        Specified by:
        listTopicsForStream in interface Admin
        Returns:
        list of topic names for the topics in the stream.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • listConsumerGroups

        public java.util.Collection<java.lang.Object> listConsumerGroups​(java.lang.String streamName)
                                                                  throws java.io.IOException,
                                                                         java.lang.IllegalArgumentException
        Description copied from interface: Admin
        List all the consumer groups within a stream.
        Specified by:
        listConsumerGroups in interface Admin
        Returns:
        list of consumer groups for the stream.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • listConsumerGroupOffsets

        public java.util.Map<org.apache.kafka.common.TopicPartition,​org.apache.kafka.clients.consumer.OffsetAndMetadata> listConsumerGroupOffsets​(java.lang.String streamName,
                                                                                                                                                        java.lang.String groupId)
                                                                                                                                                 throws java.io.IOException,
                                                                                                                                                        java.lang.IllegalArgumentException
        Description copied from interface: Admin
        List all the consumer group offsets within a stream and group id.
        Specified by:
        listConsumerGroupOffsets in interface Admin
        Returns:
        list of consumer groups for the stream.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • alterConsumerGroupOffsets

        public java.util.Map<org.apache.kafka.common.TopicPartition,​org.apache.kafka.common.protocol.Errors> alterConsumerGroupOffsets​(java.lang.String stream,
                                                                                                                                             java.lang.String groupId,
                                                                                                                                             java.util.Map<org.apache.kafka.common.TopicPartition,​org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets)
                                                                                                                                      throws java.io.IOException,
                                                                                                                                             java.lang.IllegalArgumentException
        Description copied from interface: Admin
        Alter the consumer group offsets for group with group id.
        Specified by:
        alterConsumerGroupOffsets in interface Admin
        Returns:
        list of consumer groups for the stream.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
      • alterCursors

        public java.util.List<CursorInfo> alterCursors​(java.lang.String streamName,
                                                       java.lang.String listenerGID,
                                                       java.lang.String topicName,
                                                       int feedId,
                                                       long offset)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • listCursors

        public java.util.List<CursorInfo> listCursors​(java.lang.String streamName,
                                                      java.lang.String listenerGID,
                                                      java.lang.String topicName,
                                                      int feedId)
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • listAllCursors

        public java.util.List<CursorInfo> listAllCursors​(java.lang.String streamName)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • listCursorsForTopic

        public java.util.List<CursorInfo> listCursorsForTopic​(java.lang.String topicFullName)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteCursors

        public void deleteCursors​(java.lang.String streamName,
                                  java.lang.String listenerGID,
                                  java.lang.String topicName,
                                  int feedId)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • FilterResult

        public boolean FilterResult​(org.ojai.Document rec,
                                    java.lang.String streamName,
                                    java.lang.String listenerGID,
                                    java.lang.String topic,
                                    AssignInfo ai,
                                    java.util.Map<java.lang.String,​com.mapr.fs.proto.Marlinserver.MarlinTopicMetaEntry> topicMetaMap)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • listAssigns

        public java.util.List<AssignInfo> listAssigns​(java.lang.String streamName,
                                                      java.lang.String listenerGID,
                                                      java.lang.String topicName)
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
        Description copied from interface: Admin
        Override AutoCloseable.close() to avoid declaring a checked exception.
        Specified by:
        close in interface Admin
        Specified by:
        close in interface java.lang.AutoCloseable
      • close

        @Deprecated
        public void close​(long duration,
                          java.util.concurrent.TimeUnit unit)
        Deprecated.
        Specified by:
        close in interface Admin
      • close

        public void close​(java.time.Duration timeout)
        Specified by:
        close in interface Admin