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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final com.mapr.cliframework.base.CLICommandstatic final StringFields inherited from class com.mapr.cliframework.base.CLIBaseClass
cliCommand, CLUSTER_NAME_PARAM, clusterParams, HELP_PARAM, input, isServerCall, NOT_REQUIRED, output, REQUIRED, userInfo, versionFields inherited from interface com.mapr.cliframework.base.CLIInterface
KEY_PREFIX, PASSWORD_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionDbReplicaCommands(com.mapr.cliframework.base.ProcessedInput input, com.mapr.cliframework.base.CLICommand cliCommand) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCfQualifiers(Map<Integer, SortedSet<String>> familyMap, com.mapr.fs.proto.Dbserver.TableReplicaDesc.Builder replBuilder) static voidaddIncludeDataCfQualifiers(Map<Integer, SortedSet<String>> familyMap, com.mapr.fs.proto.Dbserver.CDCInfo.Builder cdcBuilder) protected voidaddReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) protected voidautoSetup(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) protected voidautoSetupInternal(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out, boolean isDirectCopyParam, boolean isChangeLog, String replicaFullPathParam) protected voidchangeLogSetup(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) static voidcopyTable(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) protected voideditChangelogReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) protected voideditReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) com.mapr.cliframework.base.CommandOutputstatic List<com.mapr.fs.proto.Dbserver.ColumnFamily>famAttrsToFams(List<com.mapr.fs.proto.Dbserver.ColumnFamilyAttr> familyAttrs) static StringfamilyIdToName(List<com.mapr.fs.proto.Dbserver.ColumnFamilyAttr> cfAttrList, int familyId) static StringfamilyIdToNameByColumnFamily(List<com.mapr.fs.proto.Dbserver.ColumnFamily> cfList, int familyId) static List<com.mapr.fs.proto.Dbserver.ColumnFamilyAttr>getAllFamilies(String tablePath, String user) getCliParam(String key) static StringgetCompressionName(com.mapr.fs.proto.Common.FileCompressionType ct) static com.mapr.fs.proto.Common.FileCompressionTypeprotected RecentTablesListManagergetRecentListManager(String user) static StringgetTransformedTablePath(String clusterName, String tableName) static booleanisChangelogDestination(com.mapr.fs.MapRFileSystem mfs, String dstTable) static booleanisChangelogDestination(String dstTable) static booleanisExternalDestination(com.mapr.fs.MapRFileSystem mfs, String dstTable) static booleanisExternalDestination(String dstTable) protected voidlistChangelogReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) protected voidlistLogCompactionReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) protected voidlistReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) static voidparseColList(String colList, String tablePath, String user, boolean isJsonTable, Map<Integer, SortedSet<String>> familyMap) static booleanparseStreamTopicName(String fullname, String[] stnames, com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) protected voidpauseOrResumeChangelogReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out, boolean isPaused) protected voidpauseOrResumeReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out, boolean isPaused) static voidpauseOrResumeReplication(String tablePath, String replicaFullPath, boolean isPaused, String loginId) static voidpauseOrResumeReplication(String tablePath, String replicaFullPath, String topicName, boolean isPaused, String loginId) protected voidremoveChangelogReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) protected voidremoveReplica(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) static voidsetupMultiMaster(com.mapr.baseutils.utils.AceHelper.DBPermission dbPerm, com.mapr.fs.proto.Dbserver.TableReplicaDesc.Builder replBuilder, String tablePath, String replicaFullPath, String colList, String user) static voidsetupReplication(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) static voidsetupReplication(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) static voidvalidateIndexedFields(String indexedColList, String tablePath, String user) static booleanvalidateTopicName(String tname) static StringverifyExternalDstSanity(com.mapr.fs.MapRFileSystem mfs, String replicaFullPathStr) static StringverifyExternalDstSanity(String dstTable) static voidverifyStreamPath(com.mapr.fs.MapRFileSystem mfs, String streamPath, boolean streamMissingIsOk) static voidverifyStreamPath(String streamPath, boolean streamMissingIsOk) Methods inherited from class com.mapr.cliframework.base.CLIBaseClass
executeCommand, executeSimpleSHHCommand, executeSimpleSHHCommand, getBooleanParam, getCLICommand, getCommandUsage, getGIds, getInput, getKeyType, getParamBooleanValue, getParamDateValue, getParamIntValue, getParamLongValue, getParamObjectValue, getParamTextValue, getUserClusterOps, getUserCredentials, getUserId, getUserLoginId, getVersion, isParamPresent, isParamValueEmpty, setServerCall, setUserClusterOps, setUserCredentials, setUserCredentialsByJwt, setVersion, skipValidation, validateInputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mapr.cliframework.base.CLIInterface
executeCommand, getCLICommand, getGIds, getUserId, getUserLoginId, setServerCall, setUserCredentials, setUserCredentialsByJwt, setVersion, validateInput
-
Field Details
-
COLUMNS_PARAM_NAME
- See Also:
-
OUTPUT_PARAM_NAME
- See Also:
-
START_PARAM_NAME
- See Also:
-
LIMIT_PARAM_NAME
- See Also:
-
replicaCommands
public static final com.mapr.cliframework.base.CLICommand replicaCommands
-
-
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:
executeRealCommandin classcom.mapr.cliframework.base.CLIBaseClass- Throws:
com.mapr.cliframework.base.CLIProcessingException
-
getCompressionType
-
getCompressionName
-
entityName
-
validateTopicName
-
parseStreamTopicName
-
verifyStreamPath
public static void verifyStreamPath(String streamPath, boolean streamMissingIsOk) throws IOException, com.mapr.cliframework.base.CLIProcessingException - Throws:
IOExceptioncom.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:
IOExceptioncom.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.CLIProcessingExceptionUnsupportedOperationException
-
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.CLIProcessingExceptionIOException
-
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:
IOExceptioncom.mapr.cliframework.base.CLIProcessingException
-
verifyExternalDstSanity
public static String verifyExternalDstSanity(String dstTable) throws com.mapr.cliframework.base.CLIProcessingException, IOException - Throws:
com.mapr.cliframework.base.CLIProcessingExceptionIOException
-
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:
IOExceptioncom.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:
IOExceptioncom.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
-
addIncludeDataCfQualifiers
-
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.CLIProcessingExceptionIOExceptionUnsupportedOperationException
-
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.CLIProcessingExceptionIOException
-
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
-
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:
IOExceptioncom.mapr.cliframework.base.CLIProcessingException
-
familyIdToNameByColumnFamily
-
familyIdToName
-
getCliParam
- Specified by:
getCliParamin interfacecom.mapr.baseutils.utils.AceHelper.DBPermission- Throws:
IOException
-
getRecentListManager
-