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 nullPartitionSubPath() { assertThat(locationManager.getPartitionSubPath(new Path("whatever")), is(nullValue())); } | @Override public Path getPartitionSubPath(Path partitionLocation) { return null; } | ViewLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { return null; } } | ViewLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { return null; } } | ViewLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { return null; } @Override Path getTableLocation(); @Override void cleanUpLocations(); @Override List<Path> getPartitionLocations(); @Override Path getPartitionSubPath(Path partitionLocation); } | ViewLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { return null; } @Override Path getTableLocation(); @Override void cleanUpLocations(); @Override List<Path> getPartitionLocations(); @Override Path getPartitionSubPath(Path partitionLocation); } |
@Test public void getParameterFromTablePropertiesWhenSerDePropertiesAreAlsoSetInPartition() { Partition partition = newPartition(); partition.getParameters().put(AVRO_SCHEMA_URL_PARAMETER, "test"); partition.getSd().getSerdeInfo().getParameters().put(AVRO_SCHEMA_URL_PARAMETER, "foo"); assertThat(HiveObjectUtils.getPara... | public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } | HiveObjectUtils { public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } } | HiveObjectUtils { public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } private HiveObjectUtils(); } | HiveObjectUtils { public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } private HiveObjectUtils(); static String getParameter(Table table, String parameter); static String getParameter(Partition partitio... | HiveObjectUtils { public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } private HiveObjectUtils(); static String getParameter(Table table, String parameter); static String getParameter(Partition partitio... |
@Test public void getPartitionLocations() { List<Path> paths = Lists.newArrayList(path, missingPath); when(sourceLocationManager.getPartitionLocations()).thenReturn(paths); List<Path> filteredPaths = filterMissingPartitionsLocationManager.getPartitionLocations(); List<Path> expected = Lists.newArrayList(path); assertTh... | @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try { if (fileSystem == null) { fileSystem = path.getFileSystem(hiveConf); } ... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try... |
@Test public void getPartitionLocationsExceptionThrowingPathIsSkipped() { List<Path> paths = Lists.newArrayList(path, exceptionThrowingPath); when(sourceLocationManager.getPartitionLocations()).thenReturn(paths); List<Path> filteredPaths = filterMissingPartitionsLocationManager.getPartitionLocations(); List<Path> expec... | @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try { if (fileSystem == null) { fileSystem = path.getFileSystem(hiveConf); } ... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public List<Path> getPartitionLocations() throws CircusTrainException { List<Path> result = new ArrayList<>(); List<Path> paths = sourceLocationManager.getPartitionLocations(); FileSystem fileSystem = null; for (Path path : paths) { try... |
@Test public void getTableLocation() { filterMissingPartitionsLocationManager.getTableLocation(); verify(sourceLocationManager).getTableLocation(); } | @Override public Path getTableLocation() throws CircusTrainException { return sourceLocationManager.getTableLocation(); } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public Path getTableLocation() throws CircusTrainException { return sourceLocationManager.getTableLocation(); } } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public Path getTableLocation() throws CircusTrainException { return sourceLocationManager.getTableLocation(); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public Path getTableLocation() throws CircusTrainException { return sourceLocationManager.getTableLocation(); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); @Override Path getTa... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public Path getTableLocation() throws CircusTrainException { return sourceLocationManager.getTableLocation(); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); @Override Path getTa... |
@Test public void cleanUpLocations() { filterMissingPartitionsLocationManager.cleanUpLocations(); verify(sourceLocationManager).cleanUpLocations(); } | @Override public void cleanUpLocations() throws CircusTrainException { sourceLocationManager.cleanUpLocations(); } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public void cleanUpLocations() throws CircusTrainException { sourceLocationManager.cleanUpLocations(); } } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public void cleanUpLocations() throws CircusTrainException { sourceLocationManager.cleanUpLocations(); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public void cleanUpLocations() throws CircusTrainException { sourceLocationManager.cleanUpLocations(); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); @Override Path getTableLoca... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public void cleanUpLocations() throws CircusTrainException { sourceLocationManager.cleanUpLocations(); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); @Override Path getTableLoca... |
@Test public void getPartitionSubPath() { Path partitionLocation = new Path("/tmp"); filterMissingPartitionsLocationManager.getPartitionSubPath(partitionLocation); verify(sourceLocationManager).getPartitionSubPath(partitionLocation); } | @Override public Path getPartitionSubPath(Path partitionLocation) { return sourceLocationManager.getPartitionSubPath(partitionLocation); } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { return sourceLocationManager.getPartitionSubPath(partitionLocation); } } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { return sourceLocationManager.getPartitionSubPath(partitionLocation); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); } | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { return sourceLocationManager.getPartitionSubPath(partitionLocation); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); @Ov... | FilterMissingPartitionsLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { return sourceLocationManager.getPartitionSubPath(partitionLocation); } FilterMissingPartitionsLocationManager(SourceLocationManager sourceLocationManager, HiveConf hiveConf); @Ov... |
@Test public void getTable() throws Exception { when(metaStoreClient.getTable(DATABASE, TABLE)).thenReturn(table); when(metaStoreClient.getTableColumnStatistics(DATABASE, TABLE, COLUMN_NAMES)).thenReturn(columnStatisticsObjs); TableAndStatistics sourceTable = source.getTableAndStatistics(DATABASE, TABLE); assertThat(so... | @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable; } | Source extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable;... | Source extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable;... | Source extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable;... | Source extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable;... |
@Test public void getTableNoStats() throws Exception { when(metaStoreClient.getTable(DATABASE, TABLE)).thenReturn(table); when(metaStoreClient.getTableColumnStatistics(DATABASE, TABLE, COLUMN_NAMES)) .thenReturn(Collections.<ColumnStatisticsObj> emptyList()); TableAndStatistics sourceTable = source.getTableAndStatistic... | @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable; } | Source extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable;... | Source extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable;... | Source extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable;... | Source extends HiveEndpoint { @Override public TableAndStatistics getTableAndStatistics(String database, String table) { TableAndStatistics sourceTable = super.getTableAndStatistics(database, table); sourceCatalogListener.resolvedMetaStoreSourceTable(EventUtils.toEventTable(sourceTable.getTable())); return sourceTable;... |
@Test public void getPartitions() throws Exception { when(metaStoreClient.listPartitionsByFilter(DATABASE, TABLE, PARTITION_PREDICATE, (short) MAX_PARTITIONS)) .thenReturn(partitions); when(metaStoreClient.getPartitionColumnStatistics(DATABASE, TABLE, PARTITION_NAMES, COLUMN_NAMES)) .thenReturn(partitionStatsMap); Part... | @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourcePartitions(EventUtils.toEventPa... | Source extends HiveEndpoint { @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourceP... | Source extends HiveEndpoint { @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourceP... | Source extends HiveEndpoint { @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourceP... | Source extends HiveEndpoint { @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourceP... |
@Test public void getPartitionsNoStats() throws Exception { when(metaStoreClient.listPartitionsByFilter(DATABASE, TABLE, PARTITION_PREDICATE, (short) MAX_PARTITIONS)) .thenReturn(partitions); when(metaStoreClient.getPartitionColumnStatistics(DATABASE, TABLE, PARTITION_NAMES, COLUMN_NAMES)) .thenReturn(Collections.<Stri... | @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourcePartitions(EventUtils.toEventPa... | Source extends HiveEndpoint { @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourceP... | Source extends HiveEndpoint { @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourceP... | Source extends HiveEndpoint { @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourceP... | Source extends HiveEndpoint { @Override public PartitionsAndStatistics getPartitions(Table sourceTable, String partitionPredicate, int maxPartitions) throws TException { PartitionsAndStatistics sourcePartitions = super.getPartitions(sourceTable, partitionPredicate, maxPartitions); sourceCatalogListener .resolvedSourceP... |
@Test public void getLocationManagerForTable() throws Exception { SourceLocationManager locationManager = source.getLocationManager(table, EVENT_ID); assertThat(locationManager.getTableLocation(), is(new Path(TABLE_LOCATION))); } | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void getParameterFromPartitionWhichIsntSetReturnsNull() { Partition partition = newPartition(); assertTrue(HiveObjectUtils.getParameter(partition, AVRO_SCHEMA_URL_PARAMETER) == null); } | public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } | HiveObjectUtils { public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } } | HiveObjectUtils { public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } private HiveObjectUtils(); } | HiveObjectUtils { public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } private HiveObjectUtils(); static String getParameter(Table table, String parameter); static String getParameter(Partition partitio... | HiveObjectUtils { public static String getParameter(Table table, String parameter) { return getParameter(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter); } private HiveObjectUtils(); static String getParameter(Table table, String parameter); static String getParameter(Partition partitio... |
@Test public void getLocationManagerForPartitionedTable() throws Exception { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation(TABLE_LOCATION + "/partition"); partition.setSd(sd); SourceLocationManager locationManager = source.getLocationManager(table, partitions, EVENT_ID, copierOptions); assertThat(locat... | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void getLocationManagerForPartitionedTableWithBaseOverride() throws Exception { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation(TABLE_BASE_PATH + "/partition"); partition.setSd(sd); Source source = new Source(sourceCatalog, hiveConf, metaStoreClientSupplier, sourceCatalogListener, true, TABL... | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void getFilteringLocationManagerForPartitionedTableFlagTrue() throws Exception { Map<String, Object> copierOptions = new HashMap<>(); copierOptions.put(CopierOptions.IGNORE_MISSING_PARTITION_FOLDER_ERRORS, "true"); SourceLocationManager locationManager = source.getLocationManager(table, partitions, EVENT_I... | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void getNormalLocationManagerForPartitionedTableFlagFalse() throws Exception { Map<String, Object> copierOptions = new HashMap<>(); copierOptions.put(CopierOptions.IGNORE_MISSING_PARTITION_FOLDER_ERRORS, "false"); SourceLocationManager locationManager = source.getLocationManager(table, partitions, EVENT_ID... | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void getNormalLocationManagerForPartitionedTableFlagNull() throws Exception { Map<String, Object> copierOptions = new HashMap<>(); copierOptions.put(CopierOptions.IGNORE_MISSING_PARTITION_FOLDER_ERRORS, null); SourceLocationManager locationManager = source.getLocationManager(table, partitions, EVENT_ID, co... | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void getViewLocationManagerForTable() throws Exception { table.setTableType(TableType.VIRTUAL_VIEW.name()); SourceLocationManager locationManager = source.getLocationManager(table, EVENT_ID); assertThat(locationManager, is(instanceOf(ViewLocationManager.class))); } | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void getVoidLocationManagerForPartitionedTable() throws Exception { table.setTableType(TableType.VIRTUAL_VIEW.name()); partition.getSd().setLocation(null); SourceLocationManager locationManager = source.getLocationManager(table, partitions, EVENT_ID, copierOptions); assertThat(locationManager, is(instanceO... | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void overrideUnpartitionedTableLocation() throws Exception { source = new Source(sourceCatalog, hiveConf, metaStoreClientSupplier, sourceCatalogListener, true, "file: SourceLocationManager locationManager = source.getLocationManager(table, EVENT_ID); assertThat(locationManager.getTableLocation(), is(new Pa... | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void overridePartitionedTableLocationWithConfigLocation() throws Exception { source = new Source(sourceCatalog, hiveConf, metaStoreClientSupplier, sourceCatalogListener, true, "file: SourceLocationManager locationManager = source.getLocationManager(table, partitions, EVENT_ID, copierOptions); assertThat(lo... | public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCatalogListener); } | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... | Source extends HiveEndpoint { public SourceLocationManager getLocationManager(Table table, String eventId) throws IOException { if (MetaStoreUtils.isView(table)) { return new ViewLocationManager(); } return new HdfsSnapshotLocationManager(getHiveConf(), eventId, table, snapshotsDisabled, sourceTableLocation, sourceCata... |
@Test public void getTableLocationUnpartitionedTableSnapshotsDisabled() throws Exception { HdfsSnapshotLocationManager manager = new HdfsSnapshotLocationManager(hiveConf, EVENT_ID, sourceTable, true, sourceCatalogListener); Path tableLocation = manager.getTableLocation(); assertThat(tableLocation, is(new Path(TABLE_LOC... | @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } } | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... |
@Test public void updateUrlInPartition() { Partition partition = newPartition(); partition.getParameters().put(AVRO_SCHEMA_URL_PARAMETER, "test"); partition.getSd().getSerdeInfo().getParameters().put(AVRO_SCHEMA_URL_PARAMETER, "test"); HiveObjectUtils.updateSerDeUrl(partition, AVRO_SCHEMA_URL_PARAMETER, "updatedUrl"); ... | public static Table updateSerDeUrl(Table table, String parameter, String url) { updateSerDeUrl(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter, url); return table; } | HiveObjectUtils { public static Table updateSerDeUrl(Table table, String parameter, String url) { updateSerDeUrl(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter, url); return table; } } | HiveObjectUtils { public static Table updateSerDeUrl(Table table, String parameter, String url) { updateSerDeUrl(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter, url); return table; } private HiveObjectUtils(); } | HiveObjectUtils { public static Table updateSerDeUrl(Table table, String parameter, String url) { updateSerDeUrl(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter, url); return table; } private HiveObjectUtils(); static String getParameter(Table table, String parameter); static String getP... | HiveObjectUtils { public static Table updateSerDeUrl(Table table, String parameter, String url) { updateSerDeUrl(table.getParameters(), table.getSd().getSerdeInfo().getParameters(), parameter, url); return table; } private HiveObjectUtils(); static String getParameter(Table table, String parameter); static String getP... |
@Test public void getTableLocationPartitionedTableSnapshotsDisabled() throws Exception { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation(TABLE_LOCATION + "/partition1"); partition1.setSd(sd); sd = new StorageDescriptor(); sd.setLocation(TABLE_LOCATION + "/partition2"); partition2.setSd(sd); HdfsSnapshotL... | @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } } | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... |
@Test public void getTableLocationPartitionedTableSnapshotsDisabledWithOverride() throws Exception { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation(PARTITION_BASE_LOCATION + "/partition1"); partition1.setSd(sd); sd = new StorageDescriptor(); sd.setLocation(PARTITION_BASE_LOCATION + "/partition2"); parti... | @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } } | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
HiveConf sourceHiveC... |
@Test public void calculateSubPaths() { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation("/a/partition1"); partition1.setSd(sd); List<Path> subPaths = HdfsSnapshotLocationManager.calculateSubPaths(Collections.singletonList(partition1), "/a", "/b"); assertThat(subPaths.get(0).toString(), is("/b/partition1"... | static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation = partition.getSd().getLocation(); String partitionBranch = pa... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... |
@Test public void calculateSubPathsFullUri() { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation("/a/partition1"); partition1.setSd(sd); List<Path> subPaths = HdfsSnapshotLocationManager.calculateSubPaths(Collections.singletonList(partition1), "/a", "hdfs: assertThat(subPaths.get(0).toString(), is("hdfs: } | static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation = partition.getSd().getLocation(); String partitionBranch = pa... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... |
@Test public void calculateSubPathsUriEncodedPathAndPartition() { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation("hdfs: partition1.setSd(sd); List<Path> subPaths = HdfsSnapshotLocationManager.calculateSubPaths(Collections.singletonList(partition1), "hdfs: assertThat(subPaths.get(0).toString(), is("/b%25... | static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation = partition.getSd().getLocation(); String partitionBranch = pa... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... |
@Test public void calculateSubPathsTrailingSlash() { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation("/a/partition1"); partition1.setSd(sd); List<Path> subPaths = HdfsSnapshotLocationManager.calculateSubPaths(Collections.singletonList(partition1), "/a/", "/b"); assertThat(subPaths.get(0).toString(), is("... | static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation = partition.getSd().getLocation(); String partitionBranch = pa... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... | HdfsSnapshotLocationManager implements SourceLocationManager { static List<Path> calculateSubPaths( List<Partition> sourcePartitions, String sourceDataLocation, String copyBaseLocation) { List<Path> paths = new ArrayList<>(sourcePartitions.size()); for (Partition partition : sourcePartitions) { String partitionLocation... |
@Test public void partitionSubPath() throws Exception { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation(PARTITION_BASE_LOCATION + "/partition1"); partition1.setSd(sd); HdfsSnapshotLocationManager manager = new HdfsSnapshotLocationManager(hiveConf, EVENT_ID, sourceTable, Arrays.asList(partition1), false, ... | @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { throw new CircusTrainException("Partition path '" + partitionLocati... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... |
@Test public void partitionSubPathUriEncoded() throws Exception { Path path = new Path(PARTITION_BASE_LOCATION + "/partition%251"); StorageDescriptor sd = new StorageDescriptor(); sd.setLocation(path.toUri().getPath()); partition1.setSd(sd); HdfsSnapshotLocationManager manager = new HdfsSnapshotLocationManager(hiveConf... | @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { throw new CircusTrainException("Partition path '" + partitionLocati... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... |
@Test(expected = CircusTrainException.class) public void invalidPartitionSubPath() throws Exception { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation("anotherBaseLocation" + "/partition1"); partition1.setSd(sd); HdfsSnapshotLocationManager manager = new HdfsSnapshotLocationManager(hiveConf, EVENT_ID, sou... | @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { throw new CircusTrainException("Partition path '" + partitionLocati... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... | HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getPartitionSubPath(Path partitionLocation) { String sourceDataPathString = sourceDataPath.toString(); String partitionLocationString = partitionLocation.toString(); if (!partitionLocationString.startsWith(sourceDataPathString)) { thro... |
@Test public void tableExists() throws Exception { when(client.tableExists(DATABASE, TABLE)).thenReturn(true); DestructiveSource source = new DestructiveSource(sourceMetaStoreClientSupplier, tableReplication); assertThat(source.tableExists(), is(true)); verify(client).close(); } | public boolean tableExists() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.tableExists(databaseName, tableName); } } | DestructiveSource { public boolean tableExists() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.tableExists(databaseName, tableName); } } } | DestructiveSource { public boolean tableExists() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.tableExists(databaseName, tableName); } } DestructiveSource(
Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier,
TableReplication tab... | DestructiveSource { public boolean tableExists() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.tableExists(databaseName, tableName); } } DestructiveSource(
Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier,
TableReplication tab... | DestructiveSource { public boolean tableExists() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.tableExists(databaseName, tableName); } } DestructiveSource(
Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier,
TableReplication tab... |
@Test public void avroDestinationTest() { assertThat(avroDestination("file: assertThat(avroDestination("file: } | public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestinationFolder = appendFor... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... |
@Test public void getPartitionNames() throws Exception { List<String> expectedPartitionNames = Lists.newArrayList("partition1=value1"); when(client.listPartitionNames(DATABASE, TABLE, (short) -1)).thenReturn(expectedPartitionNames); DestructiveSource source = new DestructiveSource(sourceMetaStoreClientSupplier, tableRe... | public List<String> getPartitionNames() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.listPartitionNames(databaseName, tableName, ALL); } } | DestructiveSource { public List<String> getPartitionNames() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.listPartitionNames(databaseName, tableName, ALL); } } } | DestructiveSource { public List<String> getPartitionNames() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.listPartitionNames(databaseName, tableName, ALL); } } DestructiveSource(
Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier,
... | DestructiveSource { public List<String> getPartitionNames() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.listPartitionNames(databaseName, tableName, ALL); } } DestructiveSource(
Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier,
... | DestructiveSource { public List<String> getPartitionNames() throws TException { try (CloseableMetaStoreClient client = sourceMetaStoreClientSupplier.get()) { return client.listPartitionNames(databaseName, tableName, ALL); } } DestructiveSource(
Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier,
... |
@Test public void autogeneratePredicate() throws Exception { when(replica.getTableAndStatistics(tableReplication)).thenReturn(replicaTableAndStats); when(replicaTableAndStats.getTable()).thenReturn(table2); when(sourceTable.getPartitionLimit()).thenReturn((short) 10); predicate = new DiffGeneratedPartitionPredicate(sou... | @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... |
@Test public void autogeneratePredicateReplicaTableDoesNotExist() throws Exception { when(replica.getTableAndStatistics(tableReplication)).thenThrow(new CircusTrainException("Table does not exist!")); when(sourceTable.getPartitionLimit()).thenReturn((short) 10); predicate = new DiffGeneratedPartitionPredicate(source, r... | @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public String getPartitionPredicate() { if (!generated) { partitionPredicate = generate(); generated = true; } return partitionPredicate; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... |
@Test public void partitionPredicateLimit() throws Exception { when(replica.getTableAndStatistics(tableReplication)).thenReturn(replicaTableAndStats); when(replicaTableAndStats.getTable()).thenReturn(table2); when(sourceTable.getPartitionLimit()).thenReturn((short) 10); predicate = new DiffGeneratedPartitionPredicate(s... | @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... |
@Test public void noPartitionPredicateLimitSetDefaultsToMinus1() throws Exception { when(replica.getTableAndStatistics(tableReplication)).thenReturn(replicaTableAndStats); when(replicaTableAndStats.getTable()).thenReturn(table2); when(sourceTable.getPartitionLimit()).thenReturn(null); predicate = new DiffGeneratedParti... | @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... |
@Test public void partitionPredicateLimitOverriddenToZeroWhenNoDiffs() throws Exception { when(sourceTableAndStats.getTable()).thenReturn(table2); when(replica.getTableAndStatistics(tableReplication)).thenReturn(replicaTableAndStats); when(replicaTableAndStats.getTable()).thenReturn(table2); when(sourceTable.getPartiti... | @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } } | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... | DiffGeneratedPartitionPredicate implements PartitionPredicate { @Override public short getPartitionPredicateLimit() { if (Strings.isNullOrEmpty(getPartitionPredicate())) { return 0; } return partitionLimit; } DiffGeneratedPartitionPredicate(
@Nonnull HiveEndpoint source,
@Nonnull HiveEndpoint replica,
... |
@Test public void getReplicationSummary() { assertThat(locomotive.getReplicationSummary(tableReplication1), is("source-catalog:source-database.source-table to replica-catalog:replica-database.replica-table1")); } | @VisibleForTesting String getReplicationSummary(TableReplication tableReplication) { return String.format("%s:%s to %s:%s", sourceCatalog.getName(), tableReplication.getSourceTable().getQualifiedName(), replicaCatalog.getName(), tableReplication.getQualifiedReplicaName()); } | Locomotive implements ApplicationRunner, ExitCodeGenerator { @VisibleForTesting String getReplicationSummary(TableReplication tableReplication) { return String.format("%s:%s to %s:%s", sourceCatalog.getName(), tableReplication.getSourceTable().getQualifiedName(), replicaCatalog.getName(), tableReplication.getQualifiedR... | Locomotive implements ApplicationRunner, ExitCodeGenerator { @VisibleForTesting String getReplicationSummary(TableReplication tableReplication) { return String.format("%s:%s to %s:%s", sourceCatalog.getName(), tableReplication.getSourceTable().getQualifiedName(), replicaCatalog.getName(), tableReplication.getQualifiedR... | Locomotive implements ApplicationRunner, ExitCodeGenerator { @VisibleForTesting String getReplicationSummary(TableReplication tableReplication) { return String.format("%s:%s to %s:%s", sourceCatalog.getName(), tableReplication.getSourceTable().getQualifiedName(), replicaCatalog.getName(), tableReplication.getQualifiedR... | Locomotive implements ApplicationRunner, ExitCodeGenerator { @VisibleForTesting String getReplicationSummary(TableReplication tableReplication) { return String.format("%s:%s to %s:%s", sourceCatalog.getName(), tableReplication.getSourceTable().getQualifiedName(), replicaCatalog.getName(), tableReplication.getQualifiedR... |
@Test public void noMatchingPartitions() throws Exception { when(replica.getLocationManager(TableType.PARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); PartitionsAndStatistics emptyPartitionsAndStats = new PartitionsAndStatistics(sourceTable.getPartitionKeys(), Col... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... |
@Test public void typical() throws Exception { when(replica.getLocationManager(TableType.PARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); when(source.getPartitions(sourceTable, PARTITION_PREDICATE, MAX_PARTITIONS)).thenReturn(partitionsAndStatistics); TableReplica... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... |
@Test public void mappedNames() throws Exception { when(replica.getLocationManager(TableType.PARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); when(source.getPartitions(sourceTable, PARTITION_PREDICATE, MAX_PARTITIONS)).thenReturn(partitionsAndStatistics); TableRep... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... |
@Test public void avroDestinationIsSameAsReplicaLocationTest() { assertThat(avroDestination("file: assertThat(avroDestination("file: } | public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestinationFolder = appendFor... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... |
@Test public void copierListenerCalledWhenException() throws Exception { when(replica.getLocationManager(TableType.PARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); when(copier.copy()).thenThrow(new CircusTrainException("copy failed")); when(source.getPartitions(so... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... |
@Test public void replicationFailsOnDeleteTableException() throws Exception { when(replica.getLocationManager(TableType.PARTITIONED, targetTableLocation, EVENT_ID, sourceLocationManager)) .thenReturn(replicaLocationManager); when(source.getPartitions(sourceTable, PARTITION_PREDICATE, MAX_PARTITIONS)).thenReturn(partiti... | @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTableAndStatistics(database, table); Table sourceTable =... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... | PartitionedTableReplication implements Replication { @Override public void replicate() throws CircusTrainException { try { String replicaDatabaseName = tableReplication.getReplicaDatabaseName(); String replicaTableName = tableReplication.getReplicaTableName(); TableAndStatistics sourceTableAndStatistics = source.getTab... |
@Test public void failureWithoutStartOrSuccessDoesntThrowException() { Throwable throwable = new Throwable("Test"); listener.tableReplicationFailure(tableReplication, "event-id", throwable); verify(metricSender).send(metricsCaptor.capture()); Map<String, Long> metrics = metricsCaptor.getValue(); assertThat(metrics.size... | @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { sendMetrics(CompletionCode.FAILURE, tableReplication.getQualifiedReplicaName(), Metrics.NULL_VALUE); } | MetricsListener implements TableReplicationListener, CopierListener { @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { sendMetrics(CompletionCode.FAILURE, tableReplication.getQualifiedReplicaName(), Metrics.NULL_VALUE); } } | MetricsListener implements TableReplicationListener, CopierListener { @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { sendMetrics(CompletionCode.FAILURE, tableReplication.getQualifiedReplicaName(), Metrics.NULL_VALUE); } @Autowired MetricsListener(
... | MetricsListener implements TableReplicationListener, CopierListener { @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { sendMetrics(CompletionCode.FAILURE, tableReplication.getQualifiedReplicaName(), Metrics.NULL_VALUE); } @Autowired MetricsListener(
... | MetricsListener implements TableReplicationListener, CopierListener { @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { sendMetrics(CompletionCode.FAILURE, tableReplication.getQualifiedReplicaName(), Metrics.NULL_VALUE); } @Autowired MetricsListener(
... |
@Test public void failureWithoutStartOrSuccessDoesntThrowException() { Throwable throwable = new Throwable("Test"); listener.tableReplicationFailure(tableReplication, "event-id", throwable); } | @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { if (sourceCatalog != null && replicaCatalog != null) { LOG .error("[{}] Failed to replicate '{}:{}' to '{}:{}' with error '{}'", eventId, sourceCatalog.getName(), tableReplication.getSourceTable().getQua... | LoggingListener implements TableReplicationListener, LocomotiveListener, SourceCatalogListener,
ReplicaCatalogListener, CopierListener { @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { if (sourceCatalog != null && replicaCatalog != null) { LOG .er... | LoggingListener implements TableReplicationListener, LocomotiveListener, SourceCatalogListener,
ReplicaCatalogListener, CopierListener { @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { if (sourceCatalog != null && replicaCatalog != null) { LOG .er... | LoggingListener implements TableReplicationListener, LocomotiveListener, SourceCatalogListener,
ReplicaCatalogListener, CopierListener { @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { if (sourceCatalog != null && replicaCatalog != null) { LOG .er... | LoggingListener implements TableReplicationListener, LocomotiveListener, SourceCatalogListener,
ReplicaCatalogListener, CopierListener { @Override public void tableReplicationFailure(EventTableReplication tableReplication, String eventId, Throwable t) { if (sourceCatalog != null && replicaCatalog != null) { LOG .er... |
@Test public void toNullEventPartitions() { EventPartitions eventPartitions = EventUtils.toEventPartitions(table, null); assertThat(eventPartitions.getEventPartitions().size(), is(0)); } | public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey.getName(), p... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... |
@Test public void toEmptyEventPartitions() { EventPartitions eventPartitions = EventUtils.toEventPartitions(table, Collections.<Partition> emptyList()); List<EventPartition> partitions = eventPartitions.getEventPartitions(); assertThat(partitions, is(not(nullValue()))); assertThat(partitions.size(), is(0)); assertParti... | public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey.getName(), p... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... |
@Test public void toEventPartitions() { when(partitionStorageDescriptor.getLocation()).thenReturn("location"); EventPartitions eventPartitions = EventUtils.toEventPartitions(table, ImmutableList.of(partition)); List<EventPartition> partitions = eventPartitions.getEventPartitions(); assertThat(partitions, is(not(nullVal... | public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey.getName(), p... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... |
@Test public void toEventPartitionsWithNullLocation() { EventPartitions eventPartitions = EventUtils.toEventPartitions(table, ImmutableList.of(partition)); List<EventPartition> partitions = eventPartitions.getEventPartitions(); assertThat(partitions, is(not(nullValue()))); assertThat(partitions.size(), is(1)); assertTh... | public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey.getName(), p... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... | EventUtils { public static EventPartitions toEventPartitions(Table table, List<Partition> partitions) { LinkedHashMap<String, String> partitionKeyTypes = new LinkedHashMap<>(); List<FieldSchema> partitionKeys = table.getPartitionKeys(); for (FieldSchema partitionKey : partitionKeys) { partitionKeyTypes.put(partitionKey... |
@Test public void toNullEventTable() { assertThat(EventUtils.toEventTable(null), is(nullValue())); } | public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); stat... | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); stat... |
@Test public void toEventTable() { when(tableStorageDescriptor.getLocation()).thenReturn("location"); EventTable eventTable = EventUtils.toEventTable(table); assertThat(eventTable, is(not(nullValue()))); assertThat(eventTable.getPartitionKeys(), is(PARTITION_KEY_NAMES)); assertThat(eventTable.getLocation(), is(URI.crea... | public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); stat... | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); stat... |
@Test public void avroDestinationIsHiddenFolder() { String[] folders = avroDestination("dummy/url/", "123", "dummy/url").split("/"); assertThat(folders[folders.length - 1], startsWith(".")); } | public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestinationFolder = appendFor... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... |
@Test public void toEventTableWithNullLocation() { EventTable eventTable = EventUtils.toEventTable(table); assertThat(eventTable, is(not(nullValue()))); assertThat(eventTable.getPartitionKeys(), is(PARTITION_KEY_NAMES)); assertThat(eventTable.getLocation(), is(nullValue())); } | public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); } | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); stat... | EventUtils { public static EventTable toEventTable(Table sourceTable) { if (sourceTable == null) { return null; } return new EventTable(FieldSchemaUtils.getFieldNames(sourceTable.getPartitionKeys()), LocationUtils.hasLocation(sourceTable) ? LocationUtils.locationAsUri(sourceTable) : null); } private EventUtils(); stat... |
@Test public void ymlFileDoesNotExist() throws Exception { exit.expectSystemExitWithStatus(-1); File ymlFile = new File(temp.getRoot(), "test-application.yml"); CircusTrain.main(new String[] { "--config=" + ymlFile.getAbsolutePath() }); } | public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.location:${config:nul... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... |
@Test public void singleYmlFile() throws Exception { exit.expectSystemExitWithStatus(0); File ymlFile = temp.newFile("test-application.yml"); List<String> lines = ImmutableList .<String>builder() .add("extension-packages: " + TestCopierFactory.class.getPackage().getName()) .add("source-catalog:") .add(" name: source") ... | public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.location:${config:nul... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... |
@Test public void singleYmlFileWithMultipleExtensions() throws Exception { TestLocomotiveListener.testBean = null; exit.expectSystemExitWithStatus(0); File ymlFile = temp.newFile("test-application.yml"); List<String> lines = ImmutableList .<String>builder() .add("source-catalog:") .add(" name: source") .add(" configura... | public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.location:${config:nul... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... |
@Test public void twoYmlFiles() throws Exception { exit.expectSystemExitWithStatus(0); File ymlFile1 = temp.newFile("test-application1.yml"); File ymlFile2 = temp.newFile("test-application2.yml"); List<String> lines = ImmutableList .<String>builder() .add("extension-packages: " + TestCopierFactory.class.getPackage().ge... | public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.location:${config:nul... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... |
@Test public void emptyYmlFile() throws Exception { exit.expectSystemExitWithStatus(-1); File ymlFile = temp.newFile("test-application.yml"); CircusTrain.main(new String[] { "--config=" + ymlFile.getAbsolutePath() }); } | public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.location:${config:nul... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... | CircusTrain { public static void main(String[] args) throws Exception { logVersionInfo(); int exitCode = -1; try { String defaultModules = Joiner.on(",").join(Modules.REPLICATION, Modules.HOUSEKEEPING); exitCode = SpringApplication .exit(new SpringApplicationBuilder(CircusTrain.class) .properties("spring.config.locatio... |
@Test public void defaultQueueSize() { assertThat(config.getQueueSize(), is(100)); } | public int getQueueSize() { return queueSize; } | ListenerConfig { public int getQueueSize() { return queueSize; } } | ListenerConfig { public int getQueueSize() { return queueSize; } } | ListenerConfig { public int getQueueSize() { return queueSize; } void setQueueSize(int queueSize); String getStartTopic(); void setStartTopic(String startTopic); String getSuccessTopic(); void setSuccessTopic(String successTopic); String getFailTopic(); void setFailTopic(String failTopic); Map<String, String> getHeade... | ListenerConfig { public int getQueueSize() { return queueSize; } void setQueueSize(int queueSize); String getStartTopic(); void setStartTopic(String startTopic); String getSuccessTopic(); void setSuccessTopic(String successTopic); String getFailTopic(); void setFailTopic(String failTopic); Map<String, String> getHeade... |
@Test public void clearNullPartitions() throws JsonProcessingException { SnsMessage message = new SnsMessage(null, null, null, null, null, null, null, null, null, null, null, null, null, 0L, null); message.clearModifiedPartitions(); } | public void clearModifiedPartitions() { if (modifiedPartitions != null) { modifiedPartitions.clear(); } } | SnsMessage { public void clearModifiedPartitions() { if (modifiedPartitions != null) { modifiedPartitions.clear(); } } } | SnsMessage { public void clearModifiedPartitions() { if (modifiedPartitions != null) { modifiedPartitions.clear(); } } SnsMessage(
SnsMessageType type,
Map<String, String> headers,
String startTime,
String endTime,
String eventId,
String sourceCatalog,
String replicaCatalog,
... | SnsMessage { public void clearModifiedPartitions() { if (modifiedPartitions != null) { modifiedPartitions.clear(); } } SnsMessage(
SnsMessageType type,
Map<String, String> headers,
String startTime,
String endTime,
String eventId,
String sourceCatalog,
String replicaCatalog,
... | SnsMessage { public void clearModifiedPartitions() { if (modifiedPartitions != null) { modifiedPartitions.clear(); } } SnsMessage(
SnsMessageType type,
Map<String, String> headers,
String startTime,
String endTime,
String eventId,
String sourceCatalog,
String replicaCatalog,
... |
@Test public void credentials() throws IOException { when(conf.getPassword("access.key")).thenReturn("accessKey".toCharArray()); when(conf.getPassword("secret.key")).thenReturn("secretKey".toCharArray()); AWSCredentialsProvider credentialsProvider = configuration.awsCredentialsProvider(conf); AWSCredentials awsCredenti... | @Bean AWSCredentialsProvider awsCredentialsProvider( @Qualifier("replicaHiveConf") org.apache.hadoop.conf.Configuration conf) { return new AWSCredentialsProviderChain(new BasicAuth(conf), InstanceProfileCredentialsProvider.getInstance()); } | SnsConfiguration { @Bean AWSCredentialsProvider awsCredentialsProvider( @Qualifier("replicaHiveConf") org.apache.hadoop.conf.Configuration conf) { return new AWSCredentialsProviderChain(new BasicAuth(conf), InstanceProfileCredentialsProvider.getInstance()); } } | SnsConfiguration { @Bean AWSCredentialsProvider awsCredentialsProvider( @Qualifier("replicaHiveConf") org.apache.hadoop.conf.Configuration conf) { return new AWSCredentialsProviderChain(new BasicAuth(conf), InstanceProfileCredentialsProvider.getInstance()); } } | SnsConfiguration { @Bean AWSCredentialsProvider awsCredentialsProvider( @Qualifier("replicaHiveConf") org.apache.hadoop.conf.Configuration conf) { return new AWSCredentialsProviderChain(new BasicAuth(conf), InstanceProfileCredentialsProvider.getInstance()); } } | SnsConfiguration { @Bean AWSCredentialsProvider awsCredentialsProvider( @Qualifier("replicaHiveConf") org.apache.hadoop.conf.Configuration conf) { return new AWSCredentialsProviderChain(new BasicAuth(conf), InstanceProfileCredentialsProvider.getInstance()); } } |
@Test public void snsClient() { AWSCredentialsProvider credentialsProvider = mock(AWSCredentialsProvider.class); when(credentialsProvider.getCredentials()).thenReturn(new BasicAWSCredentials("accessKey", "secretKey")); ListenerConfig config = new ListenerConfig(); config.setRegion("eu-west-1"); AmazonSNS sns = configur... | @Bean AmazonSNSAsync amazonSNS(ListenerConfig config, AWSCredentialsProvider awsCredentialsProvider) { return AmazonSNSAsyncClient.asyncBuilder() .withCredentials(awsCredentialsProvider) .withRegion(config.getRegion()) .build(); } | SnsConfiguration { @Bean AmazonSNSAsync amazonSNS(ListenerConfig config, AWSCredentialsProvider awsCredentialsProvider) { return AmazonSNSAsyncClient.asyncBuilder() .withCredentials(awsCredentialsProvider) .withRegion(config.getRegion()) .build(); } } | SnsConfiguration { @Bean AmazonSNSAsync amazonSNS(ListenerConfig config, AWSCredentialsProvider awsCredentialsProvider) { return AmazonSNSAsyncClient.asyncBuilder() .withCredentials(awsCredentialsProvider) .withRegion(config.getRegion()) .build(); } } | SnsConfiguration { @Bean AmazonSNSAsync amazonSNS(ListenerConfig config, AWSCredentialsProvider awsCredentialsProvider) { return AmazonSNSAsyncClient.asyncBuilder() .withCredentials(awsCredentialsProvider) .withRegion(config.getRegion()) .build(); } } | SnsConfiguration { @Bean AmazonSNSAsync amazonSNS(ListenerConfig config, AWSCredentialsProvider awsCredentialsProvider) { return AmazonSNSAsyncClient.asyncBuilder() .withCredentials(awsCredentialsProvider) .withRegion(config.getRegion()) .build(); } } |
@Test(expected = IllegalArgumentException.class) public void nullDestinationFolderParamTest() { avroDestination(null, "123", "location"); } | public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestinationFolder = appendFor... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... |
@Test public void getMultipartCopyPartSizeDefaultIsNull() throws Exception { S3S3CopierOptions options = new S3S3CopierOptions(copierOptions); assertNull(options.getMultipartCopyPartSize()); } | public Long getMultipartCopyPartSize() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_PART_SIZE.keyName(), null); } | S3S3CopierOptions { public Long getMultipartCopyPartSize() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_PART_SIZE.keyName(), null); } } | S3S3CopierOptions { public Long getMultipartCopyPartSize() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_PART_SIZE.keyName(), null); } S3S3CopierOptions(); S3S3CopierOptions(Map<String, Object> copierOptions); } | S3S3CopierOptions { public Long getMultipartCopyPartSize() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_PART_SIZE.keyName(), null); } S3S3CopierOptions(); S3S3CopierOptions(Map<String, Object> copierOptions); void setMaxThreadPoolSize(int maxThreadPoolSize); int getMaxThreadPoolSize(); Long getMultipar... | S3S3CopierOptions { public Long getMultipartCopyPartSize() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_PART_SIZE.keyName(), null); } S3S3CopierOptions(); S3S3CopierOptions(Map<String, Object> copierOptions); void setMaxThreadPoolSize(int maxThreadPoolSize); int getMaxThreadPoolSize(); Long getMultipar... |
@Test public void getModifiedPartitionsTypical() throws URISyntaxException { List<EventPartition> created = Arrays.asList(new EventPartition(Arrays.asList("a"), new URI("location_a"))); List<EventPartition> altered = Arrays.asList(new EventPartition(Arrays.asList("b"), new URI("location_b"))); List<List<String>> partit... | @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null && partitionsToCreate == null) { return null; } List<List<String>> partitionValues = new ArrayList<>(); for (List<EventPartition> partition... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... |
@Test public void getModifiedPartitionsOneOnly() throws URISyntaxException { List<EventPartition> created = Arrays .asList(new EventPartition(Arrays.asList("a"), new URI("location_a")), new EventPartition(Arrays.asList("b"), new URI("location_b"))); List<List<String>> partitions = SnsListener.getModifiedPartitions(crea... | @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null && partitionsToCreate == null) { return null; } List<List<String>> partitionValues = new ArrayList<>(); for (List<EventPartition> partition... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... |
@Test public void getModifiedPartitionsBothNull() throws URISyntaxException { List<List<String>> partitions = SnsListener.getModifiedPartitions(null, null); assertThat(partitions, is(nullValue())); } | @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null && partitionsToCreate == null) { return null; } List<List<String>> partitionValues = new ArrayList<>(); for (List<EventPartition> partition... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... | SnsListener implements LocomotiveListener, SourceCatalogListener, ReplicaCatalogListener,
TableReplicationListener, CopierListener { @VisibleForTesting static List<List<String>> getModifiedPartitions( List<EventPartition> partitionsToAlter, List<EventPartition> partitionsToCreate) { if (partitionsToAlter == null &&... |
@Test public void isS3Scheme() { assertTrue(S3Schemes.isS3Scheme("s3")); assertTrue(S3Schemes.isS3Scheme("S3")); assertTrue(S3Schemes.isS3Scheme("s3a")); assertTrue(S3Schemes.isS3Scheme("S3A")); assertTrue(S3Schemes.isS3Scheme("s3n")); assertTrue(S3Schemes.isS3Scheme("S3N")); } | public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } | S3Schemes { public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } } | S3Schemes { public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } private S3Schemes(); } | S3Schemes { public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } private S3Schemes(); static boolean isS3Scheme(String scheme); } | S3Schemes { public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } private S3Schemes(); static boolean isS3Scheme(String scheme); } |
@Test public void isNotS3Scheme() { assertFalse(S3Schemes.isS3Scheme(null)); assertFalse(S3Schemes.isS3Scheme("")); assertFalse(S3Schemes.isS3Scheme("file")); assertFalse(S3Schemes.isS3Scheme("s321")); assertFalse(S3Schemes.isS3Scheme("sss")); } | public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } | S3Schemes { public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } } | S3Schemes { public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } private S3Schemes(); } | S3Schemes { public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } private S3Schemes(); static boolean isS3Scheme(String scheme); } | S3Schemes { public static boolean isS3Scheme(String scheme) { return S3_SCHEMES.contains(Strings.nullToEmpty(scheme).toLowerCase(Locale.ROOT)); } private S3Schemes(); static boolean isS3Scheme(String scheme); } |
@Test public void baseConfBindFileSystem() throws Exception { Configuration conf = new Configuration(); Object result = postProcessor.postProcessAfterInitialization(conf, "baseConf"); Configuration resultConf = (Configuration) result; assertThat(resultConf, is(conf)); verify(bindS3AFileSystem).bindFileSystem(conf); ver... | @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(CREDENTIAL_PROVIDER_PATH) != null) { s3CredentialsUt... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... |
@Test public void baseConfs3Credentials() throws Exception { Configuration conf = new Configuration(); conf.set(CREDENTIAL_PROVIDER_PATH, "path"); Object result = postProcessor.postProcessAfterInitialization(conf, "baseConf"); Configuration resultConf = (Configuration) result; assertThat(resultConf, is(conf)); verify(b... | @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(CREDENTIAL_PROVIDER_PATH) != null) { s3CredentialsUt... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... |
@Test public void postProcessBeforeInitializationReturnsBean() throws Exception { Object bean = new Object(); Object result = postProcessor.postProcessBeforeInitialization(bean, "bean"); assertThat(result, is(bean)); } | @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } } | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } @Autowired AWSBeanPostProcessor(BindS3AFileSystem bindS3AFileSystem, S3CredentialsUtils s3CredentialsUtils); } | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } @Autowired AWSBeanPostProcessor(BindS3AFileSystem bindS3AFileSystem, S3CredentialsUtils s3CredentialsUtils); @Override Object postProcessBefor... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } @Autowired AWSBeanPostProcessor(BindS3AFileSystem bindS3AFileSystem, S3CredentialsUtils s3CredentialsUtils); @Override Object postProcessBefor... |
@Test public void postProcessAfterInitializationReturnsBean() throws Exception { Object bean = new Object(); Object result = postProcessor.postProcessAfterInitialization(bean, "bean"); assertThat(result, is(bean)); } | @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(CREDENTIAL_PROVIDER_PATH) != null) { s3CredentialsUt... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... | AWSBeanPostProcessor implements BeanPostProcessor { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (CommonBeans.BEAN_BASE_CONF.equals(beanName)) { Configuration baseConf = (Configuration) bean; bindS3AFileSystem.bindFileSystem(baseConf); if (baseConf.get(... |
@Test(expected = NullPointerException.class) public void getCredentialsThrowsNullPointerException() { AssumeRoleCredentialProvider provider = new AssumeRoleCredentialProvider(null); provider.getCredentials(); } | @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } AssumeRoleCredentialProvider(Configuration conf); } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } AssumeRoleCredentialProvider(Configuration conf); @Override AWSCredentials get... | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } AssumeRoleCredentialProvider(Configuration conf); @Override AWSCredentials get... |
@Test(expected = IllegalArgumentException.class) public void emptyDestinationFolderParamTest() { avroDestination("", "123", "location"); } | public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestinationFolder = appendFor... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... |
@Test(expected = NullPointerException.class) public void refreshThrowsNullPointerException() { AssumeRoleCredentialProvider provider = new AssumeRoleCredentialProvider(null); provider.refresh(); } | @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } AssumeRoleCredentialProvider(Configuration conf); } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } AssumeRoleCredentialProvider(Configuration conf); @Override AWSCredentials getCredentials(); @Override void r... | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } AssumeRoleCredentialProvider(Configuration conf); @Override AWSCredentials getCredentials(); @Override void r... |
@Test(expected = IllegalArgumentException.class) public void getCredentialsThrowsIllegalArgumentException() { AssumeRoleCredentialProvider provider = new AssumeRoleCredentialProvider(new Configuration()); provider.getCredentials(); } | @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } AssumeRoleCredentialProvider(Configuration conf); } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } AssumeRoleCredentialProvider(Configuration conf); @Override AWSCredentials get... | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } return this.credentialsProvider.getCredentials(); } AssumeRoleCredentialProvider(Configuration conf); @Override AWSCredentials get... |
@Test(expected = IllegalArgumentException.class) public void refreshThrowsIllegalArgumentException() { AssumeRoleCredentialProvider provider = new AssumeRoleCredentialProvider(new Configuration()); provider.refresh(); } | @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } AssumeRoleCredentialProvider(Configuration conf); } | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } AssumeRoleCredentialProvider(Configuration conf); @Override AWSCredentials getCredentials(); @Override void r... | AssumeRoleCredentialProvider implements AWSCredentialsProvider { @Override public void refresh() { if (this.credentialsProvider == null) { initializeCredentialProvider(); } this.credentialsProvider.refresh(); } AssumeRoleCredentialProvider(Configuration conf); @Override AWSCredentials getCredentials(); @Override void r... |
@Test public void getAccessKeyFromConfTest() throws Exception { Configuration conf = new Configuration(); conf.set(AWSConstants.ACCESS_KEY, "access"); conf.set(AWSConstants.SECRET_KEY, "secret"); String access = AWSCredentialUtils.getKey(conf, AWSConstants.ACCESS_KEY); assertThat(access, is("access")); } | static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } return new String(key... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... |
@Test public void getSecretKeyFromConfTest() throws Exception { Configuration conf = new Configuration(); conf.set(AWSConstants.ACCESS_KEY, "access"); conf.set(AWSConstants.SECRET_KEY, "secret"); String secret = AWSCredentialUtils.getKey(conf, AWSConstants.SECRET_KEY); assertThat(secret, is("secret")); } | static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } return new String(key... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... |
@Test(expected = IllegalStateException.class) public void getKeyFromConfWhichIsntSetThrowsExceptionTest() throws Exception { Configuration conf = new Configuration(); AWSCredentialUtils.getKey(conf, AWSConstants.SECRET_KEY); } | static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } return new String(key... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... |
@Test(expected = RuntimeException.class) public void getKeyThrowsRuntimeExceptionTest() throws Exception { Configuration conf = mock(Configuration.class); when(conf.getPassword(anyString())).thenThrow(new IOException()); AWSCredentialUtils.getKey(conf, AWSConstants.SECRET_KEY); } | static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } return new String(key... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... | AWSCredentialUtils { static String getKey(Configuration conf, String keyType) { checkNotNull(conf, "conf cannot be null"); checkNotNull(keyType, "KeyType cannot be null"); try { char[] key = conf.getPassword(keyType); if (key == null) { throw new IllegalStateException(format("Unable to get value of '%s'", keyType)); } ... |
@Test public void toAmazonS3URISchemeIsS3() throws Exception { AmazonS3URI result = AmazonS3URIs.toAmazonS3URI(new URI("s3: AmazonS3URI expected = new AmazonS3URI("s3: assertThat(result, is(expected)); } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test public void toAmazonS3URISchemeIsS3Uppercase() throws Exception { AmazonS3URI result = AmazonS3URIs.toAmazonS3URI(new URI("S3: AmazonS3URI expected = new AmazonS3URI("s3: assertThat(result, is(expected)); } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test public void toAmazonS3URISchemeIsS3a() throws Exception { AmazonS3URI result = AmazonS3URIs.toAmazonS3URI(new URI("s3a: AmazonS3URI expected = new AmazonS3URI("s3: assertThat(result, is(expected)); } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test(expected = IllegalArgumentException.class) public void nullEventIdParamTest() { avroDestination("test", null, "location"); } | public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestinationFolder = appendFor... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... | AvroStringUtils { public static String avroDestination(String pathToDestinationFolder, String eventId, String tableLocation) { checkArgument(isNotBlank(pathToDestinationFolder), "There must be a pathToDestinationFolder provided"); checkArgument(isNotBlank(eventId), "There must be a eventId provided"); pathToDestination... |
@Test public void toAmazonS3URISchemeIsS3aUppercase() throws Exception { AmazonS3URI result = AmazonS3URIs.toAmazonS3URI(new URI("S3A: AmazonS3URI expected = new AmazonS3URI("s3: assertThat(result, is(expected)); } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test public void toAmazonS3URISchemeIsS3n() throws Exception { AmazonS3URI result = AmazonS3URIs.toAmazonS3URI(new URI("s3n: AmazonS3URI expected = new AmazonS3URI("s3: assertThat(result, is(expected)); } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test public void toAmazonS3URISchemeIsS3nUppercase() throws Exception { AmazonS3URI result = AmazonS3URIs.toAmazonS3URI(new URI("S3N: AmazonS3URI expected = new AmazonS3URI("s3: assertThat(result, is(expected)); } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test(expected = IllegalArgumentException.class) public void toAmazonS3URISchemeIsInvalidS3Scheme() throws Exception { AmazonS3URIs.toAmazonS3URI(new URI("s321: } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test(expected = IllegalArgumentException.class) public void toAmazonS3URISchemeIsNonAmazon() throws Exception { AmazonS3URIs.toAmazonS3URI(new URI("file: } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test(expected = IllegalArgumentException.class) public void toAmazonS3URISchemeIsNullScheme() throws Exception { AmazonS3URIs.toAmazonS3URI(new URI("/a/b")); } | public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(),... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... | AmazonS3URIs { public static AmazonS3URI toAmazonS3URI(URI uri) { if (FS_PROTOCOL_S3.equalsIgnoreCase(uri.getScheme())) { return new AmazonS3URI(uri); } else if (S3Schemes.isS3Scheme(uri.getScheme())) { try { return new AmazonS3URI(new URI(FS_PROTOCOL_S3, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), ... |
@Test public void credentialsFromFile() throws IOException { String jceksPath = "jceks: JceksAWSCredentialProvider provider = new JceksAWSCredentialProvider(jceksPath); AWSCredentials credentials = provider.getCredentials(); assertThat(credentials.getAWSAccessKeyId(), is("access")); assertThat(credentials.getAWSSecretK... | @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); @Override AWSCredentials getCredent... | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); @Override AWSCredentials getCredent... |
@Test public void credentialsFromConf() throws IOException { when(conf.getPassword(AWSConstants.ACCESS_KEY)).thenReturn("accessKey".toCharArray()); when(conf.getPassword(AWSConstants.SECRET_KEY)).thenReturn("secretKey".toCharArray()); JceksAWSCredentialProvider provider = new JceksAWSCredentialProvider(conf); AWSCreden... | @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); @Override AWSCredentials getCredent... | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); @Override AWSCredentials getCredent... |
@Test(expected = IllegalStateException.class) public void secretKeyNotSetInConfThrowsException() throws Exception { when(conf.getPassword(AWSConstants.ACCESS_KEY)).thenReturn("accessKey".toCharArray()); new JceksAWSCredentialProvider(conf).getCredentials(); } | @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); } | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); @Override AWSCredentials getCredent... | JceksAWSCredentialProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { if (credentials == null) { refresh(); } return credentials; } JceksAWSCredentialProvider(String credentialProviderPath); JceksAWSCredentialProvider(Configuration conf); @Override AWSCredentials getCredent... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.