target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void getHiveConf() throws Exception { assertThat(hiveEndpoint.getHiveConf(), is(hiveConf)); } | public HiveConf getHiveConf() { return hiveConf; } | HiveEndpoint { public HiveConf getHiveConf() { return hiveConf; } } | HiveEndpoint { public HiveConf getHiveConf() { return hiveConf; } @Autowired HiveEndpoint(String name, HiveConf hiveConf, Supplier<CloseableMetaStoreClient> metaStoreClientSupplier); } | HiveEndpoint { public HiveConf getHiveConf() { return hiveConf; } @Autowired HiveEndpoint(String name, HiveConf hiveConf, Supplier<CloseableMetaStoreClient> metaStoreClientSupplier); String getName(); HiveConf getHiveConf(); String getMetaStoreUris(); Supplier<CloseableMetaStoreClient> getMetaStoreClientSupplier(); Da... | HiveEndpoint { public HiveConf getHiveConf() { return hiveConf; } @Autowired HiveEndpoint(String name, HiveConf hiveConf, Supplier<CloseableMetaStoreClient> metaStoreClientSupplier); String getName(); HiveConf getHiveConf(); String getMetaStoreUris(); Supplier<CloseableMetaStoreClient> getMetaStoreClientSupplier(); Da... |
@Test public void newInstance() throws Exception { String eventId = "eventID"; Path sourceBaseLocation = new Path("source"); Path replicaLocation = new Path("replica"); Map<String, Object> copierOptions = new HashMap<>(); Copier copier = factory.newInstance(eventId, sourceBaseLocation, replicaLocation, copierOptions); ... | @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runningMetricsRegistry, new S3S3CopierOptions(copie... | S3S3CopierFactory implements CopierFactory { @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runnin... | S3S3CopierFactory implements CopierFactory { @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runnin... | S3S3CopierFactory implements CopierFactory { @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runnin... | S3S3CopierFactory implements CopierFactory { @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runnin... |
@Test public void getTable() throws Exception { when(metaStoreClient.getTable(DATABASE, TABLE)).thenReturn(table); when(metaStoreClient.getTableColumnStatistics(DATABASE, TABLE, COLUMN_NAMES)).thenReturn(columnStatisticsObjs); TableAndStatistics sourceTable = hiveEndpoint.getTableAndStatistics(DATABASE, TABLE); assertT... | public Optional<Table> getTable(CloseableMetaStoreClient client, String database, String table) { Table oldReplicaTable = null; try { log.debug("Checking for existing table {}.{}", database, table); oldReplicaTable = client.getTable(database, table); log.debug("Existing table found."); } catch (NoSuchObjectException e)... | HiveEndpoint { public Optional<Table> getTable(CloseableMetaStoreClient client, String database, String table) { Table oldReplicaTable = null; try { log.debug("Checking for existing table {}.{}", database, table); oldReplicaTable = client.getTable(database, table); log.debug("Existing table found."); } catch (NoSuchObj... | HiveEndpoint { public Optional<Table> getTable(CloseableMetaStoreClient client, String database, String table) { Table oldReplicaTable = null; try { log.debug("Checking for existing table {}.{}", database, table); oldReplicaTable = client.getTable(database, table); log.debug("Existing table found."); } catch (NoSuchObj... | HiveEndpoint { public Optional<Table> getTable(CloseableMetaStoreClient client, String database, String table) { Table oldReplicaTable = null; try { log.debug("Checking for existing table {}.{}", database, table); oldReplicaTable = client.getTable(database, table); log.debug("Existing table found."); } catch (NoSuchObj... | HiveEndpoint { public Optional<Table> getTable(CloseableMetaStoreClient client, String database, String table) { Table oldReplicaTable = null; try { log.debug("Checking for existing table {}.{}", database, table); oldReplicaTable = client.getTable(database, table); log.debug("Existing table found."); } catch (NoSuchObj... |
@Test public void getPartitions() throws Exception { List<Partition> filteredPartitions = Arrays.asList(partitionOneTwo); when(metaStoreClient.listPartitionsByFilter(DATABASE, TABLE, PARTITION_PREDICATE, (short) MAX_PARTITIONS)) .thenReturn(filteredPartitions); when(metaStoreClient.getPartitionColumnStatistics(DATABASE... | public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listPartitions(table... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... |
@Test public void getPartitionsWithoutFilter() throws Exception { when(metaStoreClient.listPartitions(DATABASE, TABLE, (short) MAX_PARTITIONS)).thenReturn(partitions); when(metaStoreClient.getPartitionColumnStatistics(DATABASE, TABLE, PARTITION_NAMES, COLUMN_NAMES)) .thenReturn(partitionStatsMap); PartitionsAndStatisti... | public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listPartitions(table... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... |
@Test public void getPartitionsNoStats() throws Exception { List<Partition> filteredPartitions = Arrays.asList(partitionOneTwo); when(metaStoreClient.listPartitionsByFilter(DATABASE, TABLE, PARTITION_PREDICATE, (short) MAX_PARTITIONS)) .thenReturn(filteredPartitions); when(metaStoreClient.getPartitionColumnStatistics(D... | public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listPartitions(table... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... | HiveEndpoint { public PartitionsAndStatistics getPartitions(Table table, String partitionPredicate, int maxPartitions) throws TException { try (CloseableMetaStoreClient client = metaStoreClientSupplier.get()) { List<Partition> partitions = null; if (Strings.isNullOrEmpty(partitionPredicate)) { partitions = client.listP... |
@Test public void newInstance() throws Exception { StrategyBasedReplicationFactory factory = new StrategyBasedReplicationFactory(upsertReplicationFactory, sourceMetaStoreClientSupplier, replicaMetaStoreClientSupplier, housekeepingListener, replicaCatalogListener); tableReplication.setReplicationStrategy(ReplicationStra... | @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPrefix()); CleanupLocationManager cleanupLocationManager = CleanupL... | StrategyBasedReplicationFactory implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPre... | StrategyBasedReplicationFactory implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPre... | StrategyBasedReplicationFactory implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPre... | StrategyBasedReplicationFactory implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPre... |
@Test public void newInstanceUpsert() throws Exception { StrategyBasedReplicationFactory factory = new StrategyBasedReplicationFactory(upsertReplicationFactory, sourceMetaStoreClientSupplier, replicaMetaStoreClientSupplier, housekeepingListener, replicaCatalogListener); tableReplication.setReplicationStrategy(Replicati... | @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPrefix()); CleanupLocationManager cleanupLocationManager = CleanupL... | StrategyBasedReplicationFactory implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPre... | StrategyBasedReplicationFactory implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPre... | StrategyBasedReplicationFactory implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPre... | StrategyBasedReplicationFactory implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { if (tableReplication.getReplicationStrategy() == ReplicationStrategy.PROPAGATE_DELETES) { String eventId = eventIdFactory.newEventId(EventIdPrefix.CIRCUS_TRAIN_DESTRUCTIVE.getPre... |
@Test public void s3ManipulatorReturnedForS3S3Copy() { replicaLocation = new Path(s3Path); dataManipulatorFactory = manager.getFactory(sourceLocation, replicaLocation, copierOptions); assertEquals(S3_S3, ((TestDataManipulatorFactory) dataManipulatorFactory).getType()); } | @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceTableLocation.toUri().getScheme(); if (copierOptions.containsKey(DATA_MANIPULATOR... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... |
@Test public void awsMapReduceManipulatorReturnedForHdfsS3Copy() { sourceLocation = new Path(hdfsPath); replicaLocation = new Path(s3Path); dataManipulatorFactory = manager.getFactory(sourceLocation, replicaLocation, copierOptions); assertEquals(S3_MAPREDUCE, ((TestDataManipulatorFactory) dataManipulatorFactory).getTyp... | @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceTableLocation.toUri().getScheme(); if (copierOptions.containsKey(DATA_MANIPULATOR... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... |
@Test public void hdfsManipulatorReturnedForHdfsCopy() { sourceLocation = new Path(hdfsPath); replicaLocation = new Path(hdfsPath); dataManipulatorFactory = manager.getFactory(sourceLocation, replicaLocation, copierOptions); assertEquals(HDFS, ((TestDataManipulatorFactory) dataManipulatorFactory).getType()); } | @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceTableLocation.toUri().getScheme(); if (copierOptions.containsKey(DATA_MANIPULATOR... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... |
@Test public void dataManipulatorReturnedFromCopierOption() { replicaLocation = new Path(hdfsPath); TestDataManipulatorFactory testFactory = new TestDataManipulatorFactory(HDFS); manager = new DefaultDataManipulatorFactoryManager(Arrays.asList(testFactory)); copierOptions.put(DATA_MANIPULATOR_FACTORY_CLASS, testFactory... | @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceTableLocation.toUri().getScheme(); if (copierOptions.containsKey(DATA_MANIPULATOR... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... |
@Test public void newInstancePartitions() throws Exception { String eventId = "eventID"; Path sourceBaseLocation = new Path("source"); Path replicaLocation = new Path("replica"); Map<String, Object> copierOptions = new HashMap<>(); List<Path> subLocations = Lists.newArrayList(new Path(sourceBaseLocation, "sub")); Copie... | @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runningMetricsRegistry, new S3S3CopierOptions(copie... | S3S3CopierFactory implements CopierFactory { @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runnin... | S3S3CopierFactory implements CopierFactory { @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runnin... | S3S3CopierFactory implements CopierFactory { @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runnin... | S3S3CopierFactory implements CopierFactory { @Override public Copier newInstance(CopierContext copierContext) { return new S3S3Copier(copierContext.getSourceBaseLocation(), copierContext.getSourceSubLocations(), copierContext.getReplicaLocation(), clientFactory, transferManagerFactory, listObjectsRequestFactory, runnin... |
@Test(expected = UnsupportedOperationException.class) public void noSupportingFactory() { replicaLocation = new Path("<path>"); dataManipulatorFactory = manager.getFactory(sourceLocation, replicaLocation, copierOptions); assertTrue(((TestDataManipulatorFactory) dataManipulatorFactory).getType() == HDFS); } | @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceTableLocation.toUri().getScheme(); if (copierOptions.containsKey(DATA_MANIPULATOR... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... | DefaultDataManipulatorFactoryManager implements DataManipulatorFactoryManager { @Override public DataManipulatorFactory getFactory( Path sourceTableLocation, Path replicaTableLocation, Map<String, Object> copierOptions) { String replicaLocation = replicaTableLocation.toUri().getScheme(); String sourceLocation = sourceT... |
@Test public void typical() throws Exception { when(replica.getLocationManager(TableType.UNPARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); TableReplication tableReplication = createTypicalTableReplication(); UnpartitionedTableReplication replication = new Unparti... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... |
@Test public void mappedNames() throws Exception { when(replica.getLocationManager(TableType.UNPARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); TableReplication tableReplication = TableReplicationUtils .createTableReplication(DATABASE, TABLE, MAPPED_DATABASE, MAPP... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... |
@Test public void copierListenerCalledWhenException() throws Exception { when(replica.getLocationManager(TableType.UNPARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); when(copier.copy()).thenThrow(new CircusTrainException("copy failed")); TableReplication tableRepl... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... |
@Test public void replicationFailsOnDeleteTableException() throws Exception { when(replica.getLocationManager(TableType.UNPARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); doThrow(new Exception()).when(replica).cleanupReplicaTableIfRequired(DATABASE, TABLE, dataMan... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... | UnpartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); replica.validateReplicaTable(replicaDatabaseName, replica... |
@Test public void listOfEnumSingleStringValue() { Map<?, ?> map = newMap(KEY, ONE.name()); List<MyEnum> actualEnums = MoreMapUtils.getListOfEnum(map, KEY, null, MyEnum.class); List<MyEnum> expectedEnums = Lists.newArrayList(ONE); assertThat(actualEnums, is(expectedEnums)); } | public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableFrom(input.getCl... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... |
@Test public void listOfEnumSingleValue() { Map<?, ?> map = newMap(KEY, ONE); List<MyEnum> actualEnums = MoreMapUtils.getListOfEnum(map, KEY, null, MyEnum.class); List<MyEnum> expectedEnums = Lists.newArrayList(ONE); assertThat(actualEnums, is(expectedEnums)); } | public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableFrom(input.getCl... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... |
@Test public void listOfEnumMultiStringValue() { Map<?, ?> map = newMap(KEY, Lists.newArrayList(ONE.name(), TWO_AND_A_HALF.name())); List<MyEnum> actualEnums = MoreMapUtils.getListOfEnum(map, KEY, null, MyEnum.class); List<MyEnum> expectedEnums = Lists.newArrayList(ONE, TWO_AND_A_HALF); assertThat(actualEnums, is(expec... | public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableFrom(input.getCl... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... |
@Test public void listOfEnumStringMultiValue() { Map<?, ?> map = newMap(KEY, ONE.name() + ", " + TWO_AND_A_HALF.name()); List<MyEnum> actualEnums = MoreMapUtils.getListOfEnum(map, KEY, null, MyEnum.class); List<MyEnum> expectedEnums = Lists.newArrayList(ONE, TWO_AND_A_HALF); assertThat(actualEnums, is(expectedEnums)); ... | public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableFrom(input.getCl... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... | MoreMapUtils { public static <T extends Enum<T>> List<T> getListOfEnum( Map<?, ?> map, Object key, List<T> defaultValue, final Class<T> enumClass) { return getList(map, key, defaultValue, new Function<Object, T>() { @Override public T apply(Object input) { if (input == null) { return null; } if (enumClass.isAssignableF... |
@Test(expected = IllegalArgumentException.class) public void invalidHadoopPath() { Map<?, ?> map = newMap(KEY, Integer.valueOf(100)); MoreMapUtils.getHadoopPath(map, KEY, null); } | public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentException( "Object '... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... |
@Test public void checkSupportsS3ToS3() { sourceLocation = new Path(s3Path); replicaLocation = new Path(s3Path); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertTrue(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... |
@Test public void noKeyReturnsDefaultHadoopPath() { Map<?, ?> map = newMap(KEY + "_+", "abc"); Path defaultPath = new Path("myPath"); assertThat(MoreMapUtils.getHadoopPath(map, KEY, defaultPath), is(defaultPath)); } | public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentException( "Object '... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... |
@Test public void nullHadoopPath() { Map<?, ?> map = newMap(KEY, null); assertThat(MoreMapUtils.getHadoopPath(map, KEY, null), is(nullValue())); } | public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentException( "Object '... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... |
@Test public void hadoopPath() { Path path = new Path("myPath"); Map<?, ?> map = newMap(KEY, path); assertThat(MoreMapUtils.getHadoopPath(map, KEY, null), is(path)); } | public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentException( "Object '... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... |
@Test public void hadoopPathAsString() { Map<?, ?> map = newMap(KEY, "myStringPath"); assertThat(MoreMapUtils.getHadoopPath(map, KEY, null), is(new Path("myStringPath"))); } | public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentException( "Object '... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... |
@Test(expected = IllegalArgumentException.class) public void invalidPathType() { Map<?, ?> map = newMap(KEY, new Object()); MoreMapUtils.getHadoopPath(map, KEY, null); } | public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentException( "Object '... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... | MoreMapUtils { public static Path getHadoopPath(Map<?, ?> map, Object key, Path defaultValue) { Object path = map.get(key); if (path == null) { return defaultValue; } if (path instanceof Path) { return (Path) path; } if (path instanceof String) { return new Path(((String) path).trim()); } throw new IllegalArgumentExcep... |
@Test(expected = IllegalArgumentException.class) public void invalidUri() { Map<?, ?> map = newMap(KEY, "s3:"); MoreMapUtils.getUri(map, KEY, null); } | public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { throw new Illegal... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... |
@Test public void noKeyReturnsDefaultUri() { Map<?, ?> map = newMap(KEY + "_+", "abc"); URI defaultUri = URI.create("my-uri"); assertThat(MoreMapUtils.getUri(map, KEY, defaultUri), is(defaultUri)); } | public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { throw new Illegal... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... |
@Test public void nullUri() { Map<?, ?> map = newMap(KEY, null); assertThat(MoreMapUtils.getUri(map, KEY, null), is(nullValue())); } | public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { throw new Illegal... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... |
@Test public void uri() { URI uri = URI.create("http: Map<?, ?> map = newMap(KEY, uri); assertThat(MoreMapUtils.getUri(map, KEY, null), is(uri)); } | public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { throw new Illegal... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... |
@Test public void uriAsString() { Map<?, ?> map = newMap(KEY, "ftp: assertThat(MoreMapUtils.getUri(map, KEY, null), is(URI.create("ftp: } | public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { throw new Illegal... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... |
@Test public void checkSupportsHdfsToS3UpperCase() { sourceLocation = new Path(s3Path.toUpperCase()); replicaLocation = new Path(s3Path.toUpperCase()); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertTrue(dataManipulatorFactory.supportsSchemes(sourceScheme, ... | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... |
@Test(expected = IllegalArgumentException.class) public void invalidUriType() { Map<?, ?> map = newMap(KEY, new Object()); MoreMapUtils.getUri(map, KEY, null); } | public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { throw new Illegal... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... | MoreMapUtils { public static URI getUri(Map<?, ?> map, Object key, URI defaultValue) { Object uri = map.get(key); if (uri == null) { return defaultValue; } if (uri instanceof URI) { return (URI) uri; } if (uri instanceof String) { try { return URI.create(((String) uri).trim()); } catch (IllegalArgumentException e) { th... |
@Test public void typical() throws Exception { when(source.getPartitions(sourceTable, PARTITION_PREDICATE, MAX_PARTITIONS)).thenReturn(partitionsAndStatistics); when(replica.getTable(replicaClient, DATABASE, TABLE)).thenReturn(Optional.of(previousReplicaTable)); when(previousReplicaTable.getSd()).thenReturn(sd); when(s... | @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePartitionsAndStatistics = source .getPartitions(sourceTable, partition... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... |
@Test public void nonExistingPartitionsAreFiltered() throws Exception { when(source.getPartitions(sourceTable, PARTITION_PREDICATE, MAX_PARTITIONS)).thenReturn(partitionsAndStatistics); when(replica.getTable(replicaClient, DATABASE, TABLE)).thenReturn(Optional.of(previousReplicaTable)); when(previousReplicaTable.getSd(... | @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePartitionsAndStatistics = source .getPartitions(sourceTable, partition... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... |
@Test public void noMatchingPartitions() throws Exception { PartitionsAndStatistics emptyPartitionsAndStats = new PartitionsAndStatistics(sourceTable.getPartitionKeys(), Collections.<Partition>emptyList(), Collections.<String, List<ColumnStatisticsObj>>emptyMap()); when(source.getPartitions(sourceTable, PARTITION_PREDI... | @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePartitionsAndStatistics = source .getPartitions(sourceTable, partition... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... |
@Test public void throwExceptionWhenReplicaTableDoesNotExist() throws Exception { expectedException.expect(CircusTrainException.class); expectedException.expectCause(isA(InvalidReplicationModeException.class)); when(source.getPartitions(sourceTable, PARTITION_PREDICATE, MAX_PARTITIONS)).thenReturn(partitionsAndStatisti... | @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePartitionsAndStatistics = source .getPartitions(sourceTable, partition... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... |
@Test public void typical() throws Exception { UnpartitionedTableMetadataMirrorReplication replication = new UnpartitionedTableMetadataMirrorReplication(DATABASE, TABLE, source, replica, eventIdFactory, DATABASE, TABLE); replication.replicate(); InOrder replicationOrder = inOrder(sourceLocationManager, replica); replic... | @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); SourceLocationManager sourceLoc... | UnpartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... | UnpartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... | UnpartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... | UnpartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... |
@Test public void supportsScheme() { defaultCopierFactoryManager = new DefaultCopierFactoryManager(Arrays.asList(copierFactory)); when(copierFactory.supportsSchemes(SCHEME, SCHEME)).thenReturn(true); CopierFactory copierFactoryResult = defaultCopierFactoryManager.getCopierFactory(path, path, ImmutableMap.<String, Objec... | @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLocation.toUri().getScheme(); if (copierOptions.containsKey(COPIER_FACTORY_CLASS)) { for (CopierFactory ... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... |
@Test(expected = UnsupportedOperationException.class) public void doesNotSupportScheme() { defaultCopierFactoryManager = new DefaultCopierFactoryManager(Arrays.asList(copierFactory)); when(copierFactory.supportsSchemes(SCHEME, SCHEME)).thenReturn(false); defaultCopierFactoryManager.getCopierFactory(path, path, Immutabl... | @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLocation.toUri().getScheme(); if (copierOptions.containsKey(COPIER_FACTORY_CLASS)) { for (CopierFactory ... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... |
@Test public void supportsSchemeWithCopierFactoryClass() { CopierFactory testCopierFactory = new TestCopierFactory(); defaultCopierFactoryManager = new DefaultCopierFactoryManager(Arrays.asList(testCopierFactory)); CopierFactory copierFactoryResult = defaultCopierFactoryManager.getCopierFactory(path, path, ImmutableMap... | @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLocation.toUri().getScheme(); if (copierOptions.containsKey(COPIER_FACTORY_CLASS)) { for (CopierFactory ... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... |
@Test(expected = UnsupportedOperationException.class) public void supportsSchemeWithCopierFactoryClassNotFound() { CopierFactory testCopierFactory = new TestCopierFactory(); defaultCopierFactoryManager = new DefaultCopierFactoryManager(Arrays.asList(testCopierFactory)); defaultCopierFactoryManager.getCopierFactory(path... | @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLocation.toUri().getScheme(); if (copierOptions.containsKey(COPIER_FACTORY_CLASS)) { for (CopierFactory ... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... | DefaultCopierFactoryManager implements com.hotels.bdp.circustrain.api.copier.CopierFactoryManager { @Override public CopierFactory getCopierFactory(Path sourceLocation, Path replicaLocation, Map<String, Object> copierOptions) { String sourceScheme = sourceLocation.toUri().getScheme(); String replicaScheme = replicaLoca... |
@Test public void checkDoesntSupportHdfs() { sourceLocation = new Path(hdfsPath); replicaLocation = new Path(hdfsPath); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... |
@Test public void getMultipartCopyThresholdDefaultIsNull() throws Exception { S3S3CopierOptions options = new S3S3CopierOptions(copierOptions); assertNull(options.getMultipartCopyThreshold()); } | public Long getMultipartCopyThreshold() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_THRESHOLD.keyName(), null); } | S3S3CopierOptions { public Long getMultipartCopyThreshold() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_THRESHOLD.keyName(), null); } } | S3S3CopierOptions { public Long getMultipartCopyThreshold() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_THRESHOLD.keyName(), null); } S3S3CopierOptions(); S3S3CopierOptions(Map<String, Object> copierOptions); } | S3S3CopierOptions { public Long getMultipartCopyThreshold() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_THRESHOLD.keyName(), null); } S3S3CopierOptions(); S3S3CopierOptions(Map<String, Object> copierOptions); void setMaxThreadPoolSize(int maxThreadPoolSize); int getMaxThreadPoolSize(); Long getMultipa... | S3S3CopierOptions { public Long getMultipartCopyThreshold() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_THRESHOLD.keyName(), null); } S3S3CopierOptions(); S3S3CopierOptions(Map<String, Object> copierOptions); void setMaxThreadPoolSize(int maxThreadPoolSize); int getMaxThreadPoolSize(); Long getMultipa... |
@Test public void simpleFilter() throws Exception { when(sourceTable.getPartitionFilter()).thenReturn("filter"); when(expressionParser.parse("filter")).thenReturn("filter"); assertThat(predicate.getPartitionPredicate(), is("filter")); } | @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilter)) { LOG.info("Parsed partitionFilter: " + parsedPartitionF... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilt... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilt... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilt... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilt... |
@Test public void expressionParserChangedFilter() throws Exception { when(expressionParser.parse("filter")).thenReturn("filter2"); when(sourceTable.getPartitionFilter()).thenReturn("filter"); assertThat(predicate.getPartitionPredicate(), is("filter2")); } | @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilter)) { LOG.info("Parsed partitionFilter: " + parsedPartitionF... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilt... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilt... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilt... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { String partitionFilter = tableReplication.getSourceTable().getPartitionFilter(); String parsedPartitionFilter = expressionParser.parse(partitionFilter); if (!Objects.equals(partitionFilter, parsedPartitionFilt... |
@Test public void partitionPredicateLimit() throws Exception { when(sourceTable.getPartitionLimit()).thenReturn((short) 10); assertThat(predicate.getPartitionPredicateLimit(), is((short) 10)); } | @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } } | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } SpelParsedPartitionPredicate(SpringExpressionParser expressionParser, Ta... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } SpelParsedPartitionPredicate(SpringExpressionParser expressionParser, Ta... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } SpelParsedPartitionPredicate(SpringExpressionParser expressionParser, Ta... |
@Test public void noPartitionPredicateLimitSetDefaultsToMinus1() throws Exception { when(sourceTable.getPartitionLimit()).thenReturn(null); assertThat(predicate.getPartitionPredicateLimit(), is((short) -1)); } | @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } } | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } SpelParsedPartitionPredicate(SpringExpressionParser expressionParser, Ta... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } SpelParsedPartitionPredicate(SpringExpressionParser expressionParser, Ta... | SpelParsedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { Short partitionLimit = tableReplication.getSourceTable().getPartitionLimit(); return partitionLimit == null ? -1 : partitionLimit; } SpelParsedPartitionPredicate(SpringExpressionParser expressionParser, Ta... |
@Test public void transform() throws Exception { transformations.add(transformationOne); transformations.add(transformationTwo); partitionTransformations = new CompositePartitionTransformation(transformations); partitionTransformations.transform(null); verify(transformationOne).transform(null); verify(transformationTwo... | @Override public Partition transform(Partition partition) { Partition transformedPartition = partition; for (PartitionTransformation partitionTransformation : partitionTransformations) { transformedPartition = partitionTransformation.transform(transformedPartition); } return transformedPartition; } | CompositePartitionTransformation implements PartitionTransformation { @Override public Partition transform(Partition partition) { Partition transformedPartition = partition; for (PartitionTransformation partitionTransformation : partitionTransformations) { transformedPartition = partitionTransformation.transform(transf... | CompositePartitionTransformation implements PartitionTransformation { @Override public Partition transform(Partition partition) { Partition transformedPartition = partition; for (PartitionTransformation partitionTransformation : partitionTransformations) { transformedPartition = partitionTransformation.transform(transf... | CompositePartitionTransformation implements PartitionTransformation { @Override public Partition transform(Partition partition) { Partition transformedPartition = partition; for (PartitionTransformation partitionTransformation : partitionTransformations) { transformedPartition = partitionTransformation.transform(transf... | CompositePartitionTransformation implements PartitionTransformation { @Override public Partition transform(Partition partition) { Partition transformedPartition = partition; for (PartitionTransformation partitionTransformation : partitionTransformations) { transformedPartition = partitionTransformation.transform(transf... |
@Test public void typical() { Table transformedTable = transformation.transform(table); Map<String, String> tableParameters = transformedTable.getParameters(); assertThat(tableParameters.size(), is(1)); assertThat(tableParameters.get(KEY), is(VALUE)); } | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void typicalImmutableTableParameters() { table.setParameters(Collections.EMPTY_MAP); Table transformedTable = transformation.transform(table); Map<String, String> tableParameters = transformedTable.getParameters(); assertThat(tableParameters.size(), is(1)); assertThat(tableParameters.get(KEY), is(VALUE)); ... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void typicalWithTableParameters() { Map<String, String> parameters = new HashMap<>(); parameters.put("old_key", "old_value"); table.setParameters(parameters); Table transformedTable = transformation.transform(table); Map<String, String> tableParameters = transformedTable.getParameters(); assertThat(tablePa... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void transformationParametersOverwriteTableParameters() { Map<String, String> parameters = new HashMap<>(); parameters.put(KEY, "old_value"); table.setParameters(parameters); Table transformedTable = transformation.transform(table); Map<String, String> tableParameters = transformedTable.getParameters(); as... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void typicalOverride() { transformation.tableReplicationStart(createEventTableReplication(OVERRIDE_KEY, OVERRIDE_VALUE), EVENT_ID); Table transformedTable = transformation.transform(table); Map<String, String> tableParameters = transformedTable.getParameters(); assertThat(tableParameters.size(), is(1)); as... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void checkDoesntSupportHdfsToS3() { sourceLocation = new Path(hdfsPath); replicaLocation = new Path(s3Path); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... |
@Test public void typicalTwoReplicationsBothOverride() { transformation.tableReplicationStart(createEventTableReplication(OVERRIDE_KEY, OVERRIDE_VALUE),EVENT_ID); transformation.transform(table); assertThat(table.getParameters().size(), is(1)); assertThat(table.getParameters().get(OVERRIDE_KEY), is(OVERRIDE_VALUE)); tr... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void typicalTwoReplicationsFirstOverride() { transformation.tableReplicationStart(createEventTableReplication(OVERRIDE_KEY, OVERRIDE_VALUE),EVENT_ID); transformation.transform(table); assertThat(table.getParameters().size(), is(1)); assertThat(table.getParameters().get(OVERRIDE_KEY), is(OVERRIDE_VALUE)); t... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void typicalTwoReplicationsSecondOverride() { transformation.tableReplicationStart(createEventTableReplication(Collections.EMPTY_MAP),EVENT_ID); transformation.transform(table); assertThat(table.getParameters().size(), is(1)); assertThat(table.getParameters().get(KEY), is(VALUE)); transformation.tableRepli... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void tableReplicationOverridesNullDefault() { transformation = new TableParametersTransformation(new TransformOptions()); transformation.tableReplicationStart(createEventTableReplication(OVERRIDE_KEY, OVERRIDE_VALUE),EVENT_ID); transformation.transform(table); assertThat(table.getParameters().size(), is(1)... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void noTransformations() { Map<String, String> parameters = new HashMap<>(); parameters.put(KEY, VALUE); table.setParameters(parameters); transformation = new TableParametersTransformation(new TransformOptions()); transformation.tableReplicationStart(createEventTableReplication(null),EVENT_ID); transformat... | @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTableParameters(tableParameters, table); table.setParameters(tableParameters); return table; } | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... | TableParametersTransformation extends AbstractTableParametersTransformation implements TableTransformation { @Override public Table transform(Table table) { Map<String, String> tableParameters = getTableParameters(); if (tableParameters == null || tableParameters.isEmpty()) { return table; } tableParameters = mergeTabl... |
@Test public void transform() throws Exception { transformations.add(transformationOne); transformations.add(transformationTwo); tableTransformations = new CompositeTableTransformation(transformations); tableTransformations.transform(null); verify(transformationOne).transform(null); verify(transformationTwo).transform(... | @Override public Table transform(Table table) { Table transformedTable = table; for (TableTransformation tableTransformation : tableTransformations) { transformedTable = tableTransformation.transform(transformedTable); } return transformedTable; } | CompositeTableTransformation implements TableTransformation { @Override public Table transform(Table table) { Table transformedTable = table; for (TableTransformation tableTransformation : tableTransformations) { transformedTable = tableTransformation.transform(transformedTable); } return transformedTable; } } | CompositeTableTransformation implements TableTransformation { @Override public Table transform(Table table) { Table transformedTable = table; for (TableTransformation tableTransformation : tableTransformations) { transformedTable = tableTransformation.transform(transformedTable); } return transformedTable; } CompositeT... | CompositeTableTransformation implements TableTransformation { @Override public Table transform(Table table) { Table transformedTable = table; for (TableTransformation tableTransformation : tableTransformations) { transformedTable = tableTransformation.transform(transformedTable); } return transformedTable; } CompositeT... | CompositeTableTransformation implements TableTransformation { @Override public Table transform(Table table) { Table transformedTable = table; for (TableTransformation tableTransformation : tableTransformations) { transformedTable = tableTransformation.transform(transformedTable); } return transformedTable; } CompositeT... |
@Test public void unpartitionedTableReplicationPartitionKeysNull() throws Exception { when(table.getPartitionKeys()).thenReturn(null); Replication replication = factory.newInstance(tableReplication); assertThat(replication, is(instanceOf(UnpartitionedTableReplication.class))); } | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void unpartitionedTableReplicationPartitionKeysEmpty() throws Exception { when(table.getPartitionKeys()).thenReturn(Collections.<FieldSchema>emptyList()); Replication replication = factory.newInstance(tableReplication); assertThat(replication, is(instanceOf(UnpartitionedTableReplication.class))); } | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void unpartitionedTableMirrorReplication() throws Exception { when(table.getPartitionKeys()).thenReturn(null); tableReplication.setReplicationMode(ReplicationMode.METADATA_MIRROR); Replication replication = factory.newInstance(tableReplication); assertThat(replication, is(instanceOf(UnpartitionedTableMetad... | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void partitionedTableReplication() throws Exception { when(table.getPartitionKeys()).thenReturn(Arrays.asList(new FieldSchema())); Replication replication = factory.newInstance(tableReplication); assertEquals(PartitionedTableReplication.class, replication.getClass()); } | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void checkDoesntSupportS3ToHdfs() { sourceLocation = new Path(s3Path); replicaLocation = new Path(hdfsPath); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... |
@Test public void partitionedTableFullOverwriteReplication() throws Exception { when(table.getPartitionKeys()).thenReturn(Arrays.asList(new FieldSchema())); tableReplication.setReplicationMode(ReplicationMode.FULL_OVERWRITE); Replication replication = factory.newInstance(tableReplication); assertEquals(PartitionedTable... | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void unpartitionedTableFullOverwriteReplication() throws Exception { when(table.getPartitionKeys()).thenReturn(null); tableReplication.setReplicationMode(ReplicationMode.FULL_OVERWRITE); Replication replication = factory.newInstance(tableReplication); assertEquals(UnpartitionedTableReplication.class, repli... | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void partitionedTableMirrorReplication() throws Exception { when(table.getPartitionKeys()).thenReturn(Arrays.asList(new FieldSchema())); tableReplication.setReplicationMode(ReplicationMode.METADATA_MIRROR); Replication replication = factory.newInstance(tableReplication); assertThat(replication, is(instance... | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void unpartitionedTableMetadataUpdateReplication() throws Exception { when(table.getPartitionKeys()).thenReturn(null); tableReplication.setReplicationMode(ReplicationMode.METADATA_UPDATE); Replication replication = factory.newInstance(tableReplication); assertThat(replication, is(instanceOf(UnpartitionedTa... | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void partitionedTableMetadataUpdateReplication() throws Exception { when(table.getPartitionKeys()).thenReturn(Arrays.asList(new FieldSchema())); tableReplication.setReplicationMode(ReplicationMode.METADATA_UPDATE); Replication replication = factory.newInstance(tableReplication); assertThat(replication, is(... | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void partitionedTableReplicationLazyLoadPartitionPredicate() throws Exception { when(table.getPartitionKeys()).thenReturn(Arrays.asList(new FieldSchema())); when(partitionPredicate.getPartitionPredicate()).thenThrow(new RuntimeException("Error!")); Replication replication = factory.newInstance(tableReplica... | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test(expected = CircusTrainException.class) public void sourceDatabaseDoesNotExist() { when(source.getDatabase(DATABASE)).thenThrow(new CircusTrainException("")); factory.newInstance(tableReplication); } | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test(expected = CircusTrainException.class) public void sourceTableDoesNotExist() { when(source.getTableAndStatistics(DATABASE, TABLE)).thenThrow(new CircusTrainException("")); factory.newInstance(tableReplication); } | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test(expected = CircusTrainException.class) public void replicaDatabaseDoesNotExist() { when(replica.getDatabase(DATABASE)).thenThrow(new CircusTrainException("")); factory.newInstance(tableReplication); } | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test(expected = CircusTrainException.class) public void viewReplicationModeIsNotMetadataMirror() { when(table.getTableType()).thenReturn(TableType.VIRTUAL_VIEW.name()); factory.newInstance(tableReplication); } | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void checkDoesntSupportRandomPaths() { sourceLocation = new Path("<path>"); replicaLocation = new Path("<path>"); sourceScheme = sourceLocation.toUri().getScheme(); replicaScheme = replicaLocation.toUri().getScheme(); assertFalse(dataManipulatorFactory.supportsSchemes(sourceScheme, replicaScheme)); } | @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); } | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... | S3DataManipulatorFactory implements DataManipulatorFactory { @Override public boolean supportsSchemes(String sourceScheme, String replicaScheme) { return S3Schemes.isS3Scheme(sourceScheme) && S3Schemes.isS3Scheme(replicaScheme); } @Autowired S3DataManipulatorFactory(AmazonS3ClientFactory s3ClientFactory); @Override S3... |
@Test public void viewReplicationModeIsMetadataMirror() { tableReplication.setReplicationMode(ReplicationMode.METADATA_MIRROR); when(table.getTableType()).thenReturn(TableType.VIRTUAL_VIEW.name()); Replication replication = factory.newInstance(tableReplication); assertThat(replication, is(instanceOf(UnpartitionedTableM... | @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); String sourceTableName = sourceTable.getTableName(); Sourc... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... | ReplicationFactoryImpl implements ReplicationFactory { @Override public Replication newInstance(TableReplication tableReplication) { Replica replica = replicaFactory.newInstance(tableReplication); SourceTable sourceTable = tableReplication.getSourceTable(); String sourceDatabaseName = sourceTable.getDatabaseName(); Str... |
@Test public void typical() throws Exception { when(source.getPartitions(sourceTable, PARTITION_PREDICATE, MAX_PARTITIONS)).thenReturn(partitionsAndStatistics); PartitionedTableMetadataMirrorReplication replication = new PartitionedTableMetadataMirrorReplication(DATABASE, TABLE, partitionPredicate, source, replica, eve... | @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePartitionsAndStatistics = source .getPartitions(sourceTable, partition... | PartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... |
@Test public void noMatchingPartitions() throws Exception { PartitionsAndStatistics emptyPartitionsAndStats = new PartitionsAndStatistics(sourceTable.getPartitionKeys(), Collections.<Partition>emptyList(), Collections.<String, List<ColumnStatisticsObj>>emptyMap()); when(source.getPartitions(sourceTable, PARTITION_PREDI... | @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePartitionsAndStatistics = source .getPartitions(sourceTable, partition... | PartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... | PartitionedTableMetadataMirrorReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable = sourceTableAndStatistics.getTable(); PartitionsAndStatistics sourcePar... |
@Test public void replicateTableExists() throws Exception { when(destructiveReplica.tableIsUnderCircusTrainControl()).thenReturn(true); when(destructiveSource.tableExists()).thenReturn(true); when(upsertReplicationFactory.newInstance(tableReplication)).thenReturn(normalReplication); when(destructiveSource.getPartitionN... | @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting replication, check configuration for correct rep... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... |
@Test public void replicateTableDoesNotExists() throws Exception { when(destructiveReplica.tableIsUnderCircusTrainControl()).thenReturn(true); when(destructiveSource.tableExists()).thenReturn(false); replication.replicate(); verifyZeroInteractions(upsertReplicationFactory); verify(destructiveReplica).dropTable(); } | @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting replication, check configuration for correct rep... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... |
@Test(expected = CircusTrainException.class) public void replicateNotCircusTrainTable() throws Exception { when(destructiveReplica.tableIsUnderCircusTrainControl()).thenReturn(false); replication.replicate(); } | @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting replication, check configuration for correct rep... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... |
@Test(expected = CircusTrainException.class) public void replicateExceptionsWrapped() throws Exception { when(destructiveReplica.tableIsUnderCircusTrainControl()).thenThrow(new TException()); replication.replicate(); } | @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting replication, check configuration for correct rep... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... | DestructiveReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { if (!destructiveReplica.tableIsUnderCircusTrainControl()) { throw new CircusTrainException("Replica table '" + tableReplication.getQualifiedReplicaName() + "' is not controlled by circus train aborting ... |
@Test public void name() throws Exception { DestructiveReplication replication = new DestructiveReplication(upsertReplicationFactory, tableReplication, EVENT_ID, destructiveSource, destructiveReplica); assertThat(replication.name(), is("destructive-db.table2")); } | @Override public String name() { return "destructive-" + tableReplication.getQualifiedReplicaName(); } | DestructiveReplication implements Replication { @Override public String name() { return "destructive-" + tableReplication.getQualifiedReplicaName(); } } | DestructiveReplication implements Replication { @Override public String name() { return "destructive-" + tableReplication.getQualifiedReplicaName(); } DestructiveReplication(
ReplicationFactoryImpl upsertReplicationFactory,
TableReplication tableReplication,
String eventId,
DestructiveSource des... | DestructiveReplication implements Replication { @Override public String name() { return "destructive-" + tableReplication.getQualifiedReplicaName(); } DestructiveReplication(
ReplicationFactoryImpl upsertReplicationFactory,
TableReplication tableReplication,
String eventId,
DestructiveSource des... | DestructiveReplication implements Replication { @Override public String name() { return "destructive-" + tableReplication.getQualifiedReplicaName(); } DestructiveReplication(
ReplicationFactoryImpl upsertReplicationFactory,
TableReplication tableReplication,
String eventId,
DestructiveSource des... |
@Test public void getEventId() throws Exception { DestructiveReplication replication = new DestructiveReplication(upsertReplicationFactory, tableReplication, EVENT_ID, destructiveSource, destructiveReplica); assertThat(replication.getEventId(), is(EVENT_ID)); } | @Override public String getEventId() { return eventId; } | DestructiveReplication implements Replication { @Override public String getEventId() { return eventId; } } | DestructiveReplication implements Replication { @Override public String getEventId() { return eventId; } DestructiveReplication(
ReplicationFactoryImpl upsertReplicationFactory,
TableReplication tableReplication,
String eventId,
DestructiveSource destructiveSource,
DestructiveReplica destr... | DestructiveReplication implements Replication { @Override public String getEventId() { return eventId; } DestructiveReplication(
ReplicationFactoryImpl upsertReplicationFactory,
TableReplication tableReplication,
String eventId,
DestructiveSource destructiveSource,
DestructiveReplica destr... | DestructiveReplication implements Replication { @Override public String getEventId() { return eventId; } DestructiveReplication(
ReplicationFactoryImpl upsertReplicationFactory,
TableReplication tableReplication,
String eventId,
DestructiveSource destructiveSource,
DestructiveReplica destr... |
@Test public void typical() throws Exception { when(replica.getTable(client, DATABASE, TABLE)).thenReturn(Optional.of(previousReplicaTable)); when(previousReplicaTable.getSd()).thenReturn(sd); when(sd.getLocation()).thenReturn(tableLocation); UnpartitionedTableMetadataUpdateReplication replication = new UnpartitionedTa... | @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = getPreviousLocation(client); ReplicaLocationManager replicaLocationMan... | UnpartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = g... | UnpartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = g... | UnpartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = g... | UnpartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = g... |
@Test public void shouldCreateDefaultTransferManagerClient() { S3S3CopierOptions s3Options = new S3S3CopierOptions(new HashMap<String, Object>() {{ put(S3S3CopierOptions.Keys.MULTIPART_COPY_THRESHOLD.keyName(), MULTIPART_COPY_THRESHOLD_VALUE); put(S3S3CopierOptions.Keys.MULTIPART_COPY_PART_SIZE.keyName(), MULTIPART_COP... | public TransferManager newInstance(AmazonS3 targetS3Client, S3S3CopierOptions s3s3CopierOptions) { LOG .debug("Initializing transfer manager with {} threads.", s3s3CopierOptions.getMaxThreadPoolSize()); return TransferManagerBuilder.standard() .withMultipartCopyThreshold(s3s3CopierOptions.getMultipartCopyThreshold()) .... | TransferManagerFactory { public TransferManager newInstance(AmazonS3 targetS3Client, S3S3CopierOptions s3s3CopierOptions) { LOG .debug("Initializing transfer manager with {} threads.", s3s3CopierOptions.getMaxThreadPoolSize()); return TransferManagerBuilder.standard() .withMultipartCopyThreshold(s3s3CopierOptions.getMu... | TransferManagerFactory { public TransferManager newInstance(AmazonS3 targetS3Client, S3S3CopierOptions s3s3CopierOptions) { LOG .debug("Initializing transfer manager with {} threads.", s3s3CopierOptions.getMaxThreadPoolSize()); return TransferManagerBuilder.standard() .withMultipartCopyThreshold(s3s3CopierOptions.getMu... | TransferManagerFactory { public TransferManager newInstance(AmazonS3 targetS3Client, S3S3CopierOptions s3s3CopierOptions) { LOG .debug("Initializing transfer manager with {} threads.", s3s3CopierOptions.getMaxThreadPoolSize()); return TransferManagerBuilder.standard() .withMultipartCopyThreshold(s3s3CopierOptions.getMu... | TransferManagerFactory { public TransferManager newInstance(AmazonS3 targetS3Client, S3S3CopierOptions s3s3CopierOptions) { LOG .debug("Initializing transfer manager with {} threads.", s3s3CopierOptions.getMaxThreadPoolSize()); return TransferManagerBuilder.standard() .withMultipartCopyThreshold(s3s3CopierOptions.getMu... |
@Test public void throwExceptionWhenReplicaTableDoesNotExist() throws Exception { expectedException.expect(CircusTrainException.class); expectedException.expectCause(isA(InvalidReplicationModeException.class)); when(replica.getTable(client, DATABASE, TABLE)).thenReturn(Optional.<Table> absent()); UnpartitionedTableMeta... | @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = getPreviousLocation(client); ReplicaLocationManager replicaLocationMan... | UnpartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = g... | UnpartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = g... | UnpartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = g... | UnpartitionedTableMetadataUpdateReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { replica.validateReplicaTable(replicaDatabaseName, replicaTableName); try (CloseableMetaStoreClient client = replica.getMetaStoreClientSupplier().get()) { String previousLocation = g... |
@Test public void newInstanceSpelParsedPartitionPredicate() throws Exception { when(sourceTable.isGeneratePartitionFilter()).thenReturn(false); PartitionPredicate predicate = partitionPredicateFactory.newInstance(tableReplication); assertThat(predicate, instanceOf(SpelParsedPartitionPredicate.class)); } | public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplication, checksumFunction); } els... | PartitionPredicateFactory { public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplicati... | PartitionPredicateFactory { public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplicati... | PartitionPredicateFactory { public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplicati... | PartitionPredicateFactory { public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplicati... |
@Test public void newInstanceDiffGeneratedPartitionPredicate() throws Exception { when(sourceTable.isGeneratePartitionFilter()).thenReturn(true); when(sourceFactory.newInstance(tableReplication)).thenReturn(source); when(replicaFactory.newInstance(tableReplication)).thenReturn(replica); PartitionPredicate predicate = p... | public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplication, checksumFunction); } els... | PartitionPredicateFactory { public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplicati... | PartitionPredicateFactory { public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplicati... | PartitionPredicateFactory { public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplicati... | PartitionPredicateFactory { public PartitionPredicate newInstance(TableReplication tableReplication) { if (tableReplication.getSourceTable().isGeneratePartitionFilter()) { return new DiffGeneratedPartitionPredicate(sourceFactory.newInstance(tableReplication), replicaFactory.newInstance(tableReplication), tableReplicati... |
@Test(expected = IllegalArgumentException.class) public void getStatisticsForPartitionNullArgument() { List<FieldSchema> partitionKeys = Lists.newArrayList(newFieldSchema("a")); List<Partition> partitions = Lists.newArrayList(); PartitionsAndStatistics partitionsAndStatistics = new PartitionsAndStatistics(partitionKeys... | public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } } | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... |
@Test public void getStatisticsForPartitionReturnsNullIfNotPresent() throws Exception { List<FieldSchema> partitionKeys = Lists.newArrayList(newFieldSchema("a")); Table table = newTable("t1", "db1", partitionKeys, newStorageDescriptor(new File("bla"), "col1")); List<Partition> partitions = Lists.newArrayList(newPartiti... | public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } } | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... |
@Test public void getStatisticsForPartitionReturnsNullIfEmptyStats() throws Exception { List<FieldSchema> partitionKeys = Lists.newArrayList(newFieldSchema("a")); Table table = newTable("t1", "db1", partitionKeys, newStorageDescriptor(new File("bla"), "col1")); List<Partition> partitions = Lists.newArrayList(newPartiti... | public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } } | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... | PartitionsAndStatistics { public ColumnStatistics getStatisticsForPartition(Partition partition) { if (partition == null) { throw new IllegalArgumentException("partition == null"); } return statisticsByPartition.get(partition); } PartitionsAndStatistics(
List<FieldSchema> partitionKeys,
List<Partition> part... |
@Test public void nowInZone() { DateTime now = ExpressionParserFunctions.nowInZone("UTC"); assertThat(now.getZone(), is(DateTimeZone.UTC)); } | private static DateTime nowInZone(DateTimeZone zone) { return DateTime.now(zone); } | ExpressionParserFunctions { private static DateTime nowInZone(DateTimeZone zone) { return DateTime.now(zone); } } | ExpressionParserFunctions { private static DateTime nowInZone(DateTimeZone zone) { return DateTime.now(zone); } private ExpressionParserFunctions(); } | ExpressionParserFunctions { private static DateTime nowInZone(DateTimeZone zone) { return DateTime.now(zone); } private ExpressionParserFunctions(); static DateTime nowInZone(String zone); static DateTime nowUtc(); static DateTime nowEuropeLondon(); static DateTime nowAmericaLosAngeles(); static String zeroPadLeft(int... | ExpressionParserFunctions { private static DateTime nowInZone(DateTimeZone zone) { return DateTime.now(zone); } private ExpressionParserFunctions(); static DateTime nowInZone(String zone); static DateTime nowUtc(); static DateTime nowEuropeLondon(); static DateTime nowAmericaLosAngeles(); static String zeroPadLeft(int... |
@Test public void nowUtc() { DateTime now = ExpressionParserFunctions.nowUtc(); assertThat(now.getZone(), is(DateTimeZone.UTC)); } | public static DateTime nowUtc() { return nowInZone(DateTimeZone.UTC); } | ExpressionParserFunctions { public static DateTime nowUtc() { return nowInZone(DateTimeZone.UTC); } } | ExpressionParserFunctions { public static DateTime nowUtc() { return nowInZone(DateTimeZone.UTC); } private ExpressionParserFunctions(); } | ExpressionParserFunctions { public static DateTime nowUtc() { return nowInZone(DateTimeZone.UTC); } private ExpressionParserFunctions(); static DateTime nowInZone(String zone); static DateTime nowUtc(); static DateTime nowEuropeLondon(); static DateTime nowAmericaLosAngeles(); static String zeroPadLeft(int value, int ... | ExpressionParserFunctions { public static DateTime nowUtc() { return nowInZone(DateTimeZone.UTC); } private ExpressionParserFunctions(); static DateTime nowInZone(String zone); static DateTime nowUtc(); static DateTime nowEuropeLondon(); static DateTime nowAmericaLosAngeles(); static String zeroPadLeft(int value, int ... |
@Test public void nowEuropeLondon() { DateTime now = ExpressionParserFunctions.nowEuropeLondon(); assertThat(now.getZone(), is(DateTimeZone.forID("Europe/London"))); } | public static DateTime nowEuropeLondon() { return nowInZone("Europe/London"); } | ExpressionParserFunctions { public static DateTime nowEuropeLondon() { return nowInZone("Europe/London"); } } | ExpressionParserFunctions { public static DateTime nowEuropeLondon() { return nowInZone("Europe/London"); } private ExpressionParserFunctions(); } | ExpressionParserFunctions { public static DateTime nowEuropeLondon() { return nowInZone("Europe/London"); } private ExpressionParserFunctions(); static DateTime nowInZone(String zone); static DateTime nowUtc(); static DateTime nowEuropeLondon(); static DateTime nowAmericaLosAngeles(); static String zeroPadLeft(int val... | ExpressionParserFunctions { public static DateTime nowEuropeLondon() { return nowInZone("Europe/London"); } private ExpressionParserFunctions(); static DateTime nowInZone(String zone); static DateTime nowUtc(); static DateTime nowEuropeLondon(); static DateTime nowAmericaLosAngeles(); static String zeroPadLeft(int val... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.