Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2022-2025 Google LLC
* Copyright 2013-2021 CompilerWorks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.edwmigration.dumper.application.dumper.annotations;

import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import java.lang.annotation.*;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@AvoidInput(
arg = ConnectorArguments.OPT_ASSESSMENT,
description = AvoidArgumentAssessment.DESCRIPTION)
public @interface AvoidArgumentAssessment {

String DESCRIPTION = "The argument must not be used with this connector.";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright 2022-2025 Google LLC
* Copyright 2013-2021 CompilerWorks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.edwmigration.dumper.application.dumper.annotations;

import java.lang.annotation.*;
import javax.annotation.Nonnull;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Repeatable(AvoidInputs.class)
public @interface AvoidInput {

@Nonnull
String arg() default "";

@Nonnull
String description();

@Nonnull
String defaultValue() default "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2022-2025 Google LLC
* Copyright 2013-2021 CompilerWorks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.edwmigration.dumper.application.dumper.annotations;

import java.lang.annotation.*;
import javax.annotation.Nonnull;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface AvoidInputs {

@Nonnull
AvoidInput[] value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
public @interface RespectsInput {

@Nonnull
public String arg() default "";
String arg() default "";

@Nonnull
public String env() default "";
String env() default "";

@Nonnull
public String description();
String description();

@Nonnull
public String defaultValue() default "";
String defaultValue() default "";

public int order() default Integer.MAX_VALUE;
int order() default Integer.MAX_VALUE;

@Nonnull
public String required() default "";
String required() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@
import com.google.cloud.bigquery.TableId;
import com.google.common.collect.ImmutableList;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentQueryLogDays;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentQueryLogEnd;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentQueryLogStart;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.annotations.*;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.LogsConnector;
import com.google.edwmigration.dumper.application.dumper.connector.ZonedInterval;
Expand Down Expand Up @@ -69,6 +66,7 @@
@RespectsArgumentQueryLogDays
@RespectsArgumentQueryLogStart
@RespectsArgumentQueryLogEnd
@AvoidArgumentAssessment
public class BigQueryLogsConnector extends AbstractBigQueryConnector
implements LogsConnector, BigQueryLogsDumpFormat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.AvoidArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.MetadataConnector;
Expand Down Expand Up @@ -77,6 +78,7 @@
order = 2000,
arg = ConnectorArguments.OPT_SCHEMA,
description = "The list of datasets to dump, separated by commas.")
@AvoidArgumentAssessment
public class BigQueryMetadataConnector extends AbstractBigQueryConnector
implements BigQueryMetadataDumpFormat, MetadataConnector {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.auto.service.AutoService;
import com.google.common.base.Preconditions;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.connector.AbstractConnector;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
Expand Down Expand Up @@ -64,6 +65,7 @@
arg = ConnectorArguments.OPT_CLUSTER,
description = "The name of Cloudera's cluster.",
required = "Only if you need to dump data for a single Cloudera cluster")
@RespectsArgumentAssessment
public class ClouderaManagerConnector extends AbstractConnector {

private static final String FORMAT_NAME = "cloudera-manager.dump.zip";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.auto.service.AutoService;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.MetadataDumperUsageException;
import com.google.edwmigration.dumper.application.dumper.annotations.AvoidArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.connector.AbstractJdbcConnector;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.LogsConnector;
Expand Down Expand Up @@ -48,6 +49,7 @@
* generates multiple queries and is like 'logs' mode.
*/
@AutoService({Connector.class, LogsConnector.class})
@AvoidArgumentAssessment
public class GenericConnector extends AbstractJdbcConnector implements LogsConnector {

private static final Logger logger = LoggerFactory.getLogger(GenericConnector.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.auto.service.AutoService;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.AvoidArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentDatabaseForConnection;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
Expand All @@ -39,6 +40,7 @@
required = ConnectorArguments.OPT_REQUIRED_IF_NOT_URL,
defaultValue = "" + GreenplumMetadataConnector.OPT_PORT_DEFAULT)
@RespectsArgumentDatabaseForConnection
@AvoidArgumentAssessment
public class GreenplumMetadataConnector extends AbstractGreenplumConnector
implements MetadataConnector, GreenplumMetadataDumpFormat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.ConnectorProperty;
import com.google.edwmigration.dumper.application.dumper.connector.MetadataConnector;
Expand All @@ -41,6 +42,7 @@

@AutoService({Connector.class, MetadataConnector.class})
@Description("Dumps metadata from the Hadoop cluster via bash commands.")
@RespectsArgumentAssessment
public class HadoopMetadataConnector implements MetadataConnector {

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.auto.service.AutoService;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.connector.AbstractConnector;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
Expand Down Expand Up @@ -48,6 +49,7 @@
description = "The size of the thread pool to use when extracting hdfs filesystem.")
@AutoService({Connector.class})
@Description("Dumps files and directories from the HDFS.")
@RespectsArgumentAssessment
public class HdfsExtractionConnector extends AbstractConnector implements HdfsExtractionDumpFormat {

public HdfsExtractionConnector() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.google.common.io.ByteSink;
import com.google.common.net.PercentEscaper;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentDatabasePredicate;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.MetadataConnector;
Expand Down Expand Up @@ -73,6 +74,7 @@
@RespectsArgumentDatabasePredicate
@AutoService({Connector.class, MetadataConnector.class})
@Description("Dumps metadata from the Hive metastore via Thrift.")
@RespectsArgumentAssessment
public class HiveMetadataConnector extends AbstractHiveConnector
implements HiveMetadataDumpFormat, MetadataConnector {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.auto.service.AutoService;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.MetadataConnector;
import com.google.edwmigration.dumper.application.dumper.task.DumpMetadataTask;
Expand All @@ -38,6 +39,7 @@
*/
@AutoService({Connector.class, MetadataConnector.class})
@Description("Dumps metadata from MySQL.")
@RespectsArgumentAssessment
public class MysqlMetadataConnector extends AbstractMysqlConnector
implements MetadataConnector, MysqlMetadataDumpFormat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@
import com.google.common.base.Preconditions;
import com.google.common.io.ByteSink;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentDatabasePredicate;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentDriverRequired;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentHostUnlessUrl;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentJDBCUri;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentPassword;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentUser;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.annotations.*;
import com.google.edwmigration.dumper.application.dumper.connector.AbstractJdbcConnector;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.MetadataConnector;
Expand Down Expand Up @@ -85,6 +79,7 @@
@RespectsArgumentPassword
@RespectsArgumentJDBCUri
@RespectsArgumentDatabasePredicate
@RespectsArgumentAssessment
public class NetezzaMetadataConnector extends AbstractJdbcConnector
implements MetadataConnector, NetezzaMetadataDumpFormat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.auto.service.AutoService;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.AvoidArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.LogsConnector;
import com.google.edwmigration.dumper.application.dumper.task.DumpMetadataTask;
Expand All @@ -31,6 +32,7 @@

@AutoService({Connector.class, LogsConnector.class})
@Description("Dumps query logs from Oracle")
@AvoidArgumentAssessment
public class OracleLogsConnector extends AbstractOracleConnector
implements LogsConnector, OracleLogsDumpFormat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.auto.service.AutoService;
import com.google.common.base.Preconditions;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.MetadataConnector;
import com.google.edwmigration.dumper.application.dumper.connector.oracle.task.GroupTask;
Expand All @@ -39,6 +40,7 @@

@AutoService({Connector.class, MetadataConnector.class})
@Description("Dumps metadata from Oracle")
@RespectsArgumentAssessment
public class OracleMetadataConnector extends AbstractOracleConnector
implements MetadataConnector, OracleMetadataDumpFormat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.common.collect.Range;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.MetadataDumperUsageException;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.task.Task;
import com.google.edwmigration.dumper.plugin.ext.jdk.annotation.Description;
Expand All @@ -32,6 +33,7 @@
@AutoService(Connector.class)
@Description("Dumps aggregated statistics from Oracle")
@ParametersAreNonnullByDefault
@RespectsArgumentAssessment
public class OracleStatsConnector extends AbstractOracleConnector {

static final Duration DEFAULT_DURATION = ofDays(30);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.auto.service.AutoService;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentDatabaseForConnection;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
Expand All @@ -40,6 +41,7 @@
required = ConnectorArguments.OPT_REQUIRED_IF_NOT_URL,
defaultValue = "" + PostgresqlMetadataConnector.OPT_PORT_DEFAULT)
@RespectsArgumentDatabaseForConnection
@RespectsArgumentAssessment
public class PostgresqlMetadataConnector extends AbstractPostgresqlConnector
implements MetadataConnector, PostgresqlMetadataDumpFormat {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.io.ByteSink;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.annotations.AvoidArgumentAssessment;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.connector.AbstractConnector;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
Expand Down Expand Up @@ -61,6 +62,7 @@
defaultValue = ConnectorArguments.OPT_RANGER_PORT_DEFAULT)
@AutoService({Connector.class})
@Description("Dumps services and policies from Apache Ranger.")
@AvoidArgumentAssessment
public class RangerConnector extends AbstractConnector {

@SuppressWarnings("UnusedVariable")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import com.google.auto.service.AutoService;
import com.google.edwmigration.dumper.application.dumper.ConnectorArguments;
import com.google.edwmigration.dumper.application.dumper.MetadataDumperUsageException;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentQueryLogDays;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentQueryLogEnd;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsArgumentQueryLogStart;
import com.google.edwmigration.dumper.application.dumper.annotations.RespectsInput;
import com.google.edwmigration.dumper.application.dumper.annotations.*;
import com.google.edwmigration.dumper.application.dumper.connector.Connector;
import com.google.edwmigration.dumper.application.dumper.connector.LogsConnector;
import com.google.edwmigration.dumper.application.dumper.connector.ZonedInterval;
Expand Down Expand Up @@ -59,6 +56,7 @@
@RespectsArgumentQueryLogDays
@RespectsArgumentQueryLogStart
@RespectsArgumentQueryLogEnd
@AvoidArgumentAssessment
public class RedshiftLogsConnector extends AbstractRedshiftConnector
implements LogsConnector, RedshiftLogsDumpFormat {

Expand Down
Loading
Loading