Package com.mapr.cli

Class DbReplicaCommands

java.lang.Object
com.mapr.cliframework.base.CLIBaseClass
com.mapr.cli.DbReplicaCommands
All Implemented Interfaces:
com.mapr.baseutils.utils.AceHelper.DBPermission, com.mapr.cliframework.base.CLIInterface
Direct Known Subclasses:
ChangeLogReplicaCommands, StreamCompactCommands, StreamReplicaCommands

public class DbReplicaCommands extends com.mapr.cliframework.base.CLIBaseClass implements com.mapr.cliframework.base.CLIInterface, com.mapr.baseutils.utils.AceHelper.DBPermission
  • Field Details

  • Constructor Details

    • DbReplicaCommands

      public DbReplicaCommands(com.mapr.cliframework.base.ProcessedInput input, com.mapr.cliframework.base.CLICommand cliCommand)
  • Method Details

    • executeRealCommand

      public com.mapr.cliframework.base.CommandOutput executeRealCommand() throws com.mapr.cliframework.base.CLIProcessingException
      Specified by:
      executeRealCommand in class com.mapr.cliframework.base.CLIBaseClass
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • getCompressionType

      public static com.mapr.fs.proto.Common.FileCompressionType getCompressionType(String cs)
    • getCompressionName

      public static String getCompressionName(com.mapr.fs.proto.Common.FileCompressionType ct)
    • entityName

      public String entityName()
    • validateTopicName

      public static boolean validateTopicName(String tname)
    • parseStreamTopicName

      public static boolean parseStreamTopicName(String fullname, String[] stnames, com.mapr.cliframework.base.CommandOutput.OutputHierarchy out)
    • verifyStreamPath

      public static void verifyStreamPath(String streamPath, boolean streamMissingIsOk) throws IOException, com.mapr.cliframework.base.CLIProcessingException
      Throws:
      IOException
      com.mapr.cliframework.base.CLIProcessingException
    • verifyStreamPath

      public static void verifyStreamPath(com.mapr.fs.MapRFileSystem mfs, String streamPath, boolean streamMissingIsOk) throws IOException, com.mapr.cliframework.base.CLIProcessingException
      Throws:
      IOException
      com.mapr.cliframework.base.CLIProcessingException
    • changeLogSetup

      protected void changeLogSetup(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • autoSetupInternal

      protected void autoSetupInternal(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out, boolean isDirectCopyParam, boolean isChangeLog, String replicaFullPathParam) throws com.mapr.cliframework.base.CLIProcessingException, UnsupportedOperationException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
      UnsupportedOperationException
    • autoSetup

      protected void autoSetup(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • verifyExternalDstSanity

      public static String verifyExternalDstSanity(com.mapr.fs.MapRFileSystem mfs, String replicaFullPathStr) throws com.mapr.cliframework.base.CLIProcessingException, IOException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
      IOException
    • setupMultiMaster

      public static void setupMultiMaster(com.mapr.baseutils.utils.AceHelper.DBPermission dbPerm, com.mapr.fs.proto.Dbserver.TableReplicaDesc.Builder replBuilder, String tablePath, String replicaFullPath, String colList, String user) throws IOException, com.mapr.cliframework.base.CLIProcessingException
      Throws:
      IOException
      com.mapr.cliframework.base.CLIProcessingException
    • verifyExternalDstSanity

      public static String verifyExternalDstSanity(String dstTable) throws com.mapr.cliframework.base.CLIProcessingException, IOException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
      IOException
    • isChangelogDestination

      public static boolean isChangelogDestination(com.mapr.fs.MapRFileSystem mfs, String dstTable) throws IOException
      Throws:
      IOException
    • isChangelogDestination

      public static boolean isChangelogDestination(String dstTable) throws IOException, com.mapr.cliframework.base.CLIProcessingException
      Throws:
      IOException
      com.mapr.cliframework.base.CLIProcessingException
    • isExternalDestination

      public static boolean isExternalDestination(com.mapr.fs.MapRFileSystem mfs, String dstTable) throws IOException
      Throws:
      IOException
    • isExternalDestination

      public static boolean isExternalDestination(String dstTable) throws IOException, com.mapr.cliframework.base.CLIProcessingException
      Throws:
      IOException
      com.mapr.cliframework.base.CLIProcessingException
    • addReplica

      protected void addReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • validateIndexedFields

      public static void validateIndexedFields(String indexedColList, String tablePath, String user) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • parseColList

      public static void parseColList(String colList, String tablePath, String user, boolean isJsonTable, Map<Integer,SortedSet<String>> familyMap) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • addCfQualifiers

      public static void addCfQualifiers(Map<Integer,SortedSet<String>> familyMap, com.mapr.fs.proto.Dbserver.TableReplicaDesc.Builder replBuilder)
    • addIncludeDataCfQualifiers

      public static void addIncludeDataCfQualifiers(Map<Integer,SortedSet<String>> familyMap, com.mapr.fs.proto.Dbserver.CDCInfo.Builder cdcBuilder)
    • setupReplication

      public static void setupReplication(com.mapr.baseutils.utils.AceHelper.DBPermission dbPerm, com.mapr.fs.proto.Dbserver.TableReplicaDesc.Builder replBuilder, String tablePath, String replicaFullPath, String clist, String indexedColList, String user, com.mapr.fs.MapRFileSystem mfs, String replicaClassName, boolean isDirectCopy, boolean isMultimaster, boolean useExistingReplica) throws com.mapr.cliframework.base.CLIProcessingException, IOException, UnsupportedOperationException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
      IOException
      UnsupportedOperationException
    • setupReplication

      public static void setupReplication(com.mapr.baseutils.utils.AceHelper.DBPermission dbPerm, com.mapr.fs.proto.Dbserver.TableReplicaDesc.Builder replBuilder, String tablePath, String replicaFullPath, String topic, String clist, String indexedColList, String includeColumns, String user, com.mapr.fs.MapRFileSystem mfs, String replicaClassName, boolean isDirectCopy, boolean isMultimaster, boolean useExistingReplica, boolean useExistingTopic, boolean propagateExistingData, boolean multiversion) throws com.mapr.cliframework.base.CLIProcessingException, IOException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
      IOException
    • copyTable

      public static void copyTable(String tablePath, String replicaFullPath, int maxVersions, String colList, String user, boolean waitForCompletion, String ticketPath, boolean isMultiMaster, com.mapr.baseutils.utils.AceHelper.DBPermission dbPerm, com.mapr.fs.proto.Dbserver.TableReplicaDesc.Builder replBuilder) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • listChangelogReplica

      protected void listChangelogReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • listLogCompactionReplica

      protected void listLogCompactionReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • listReplica

      protected void listReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • famAttrsToFams

      public static List<com.mapr.fs.proto.Dbserver.ColumnFamily> famAttrsToFams(List<com.mapr.fs.proto.Dbserver.ColumnFamilyAttr> familyAttrs) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • getTransformedTablePath

      public static String getTransformedTablePath(String clusterName, String tableName)
    • editChangelogReplica

      protected void editChangelogReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • editReplica

      protected void editReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • removeChangelogReplica

      protected void removeChangelogReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • removeReplica

      protected void removeReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • pauseOrResumeReplication

      public static void pauseOrResumeReplication(String tablePath, String replicaFullPath, boolean isPaused, String loginId) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • pauseOrResumeReplication

      public static void pauseOrResumeReplication(String tablePath, String replicaFullPath, String topicName, boolean isPaused, String loginId) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • pauseOrResumeChangelogReplica

      protected void pauseOrResumeChangelogReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out, boolean isPaused) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • pauseOrResumeReplica

      protected void pauseOrResumeReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out, boolean isPaused) throws com.mapr.cliframework.base.CLIProcessingException
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • getAllFamilies

      public static List<com.mapr.fs.proto.Dbserver.ColumnFamilyAttr> getAllFamilies(String tablePath, String user) throws IOException, com.mapr.cliframework.base.CLIProcessingException
      Throws:
      IOException
      com.mapr.cliframework.base.CLIProcessingException
    • familyIdToNameByColumnFamily

      public static String familyIdToNameByColumnFamily(List<com.mapr.fs.proto.Dbserver.ColumnFamily> cfList, int familyId)
    • familyIdToName

      public static String familyIdToName(List<com.mapr.fs.proto.Dbserver.ColumnFamilyAttr> cfAttrList, int familyId)
    • getCliParam

      public String getCliParam(String key) throws IOException
      Specified by:
      getCliParam in interface com.mapr.baseutils.utils.AceHelper.DBPermission
      Throws:
      IOException
    • getRecentListManager

      protected RecentTablesListManager getRecentListManager(String user)