@Override public TableAvailability getAvailability() { if (!_facade) { return new TableAvailability(_options.getPlacement(), false); } // Facades aren't fully supported throw new UnsupportedOperationException(); }
@Override public TableAvailability getAvailability() { if (!_facade) { return new TableAvailability(_options.getPlacement(), false); } // Facades aren't fully supported throw new UnsupportedOperationException(); }
@Nullable private Table loadBootstrapTable(String name) { // Each system table uses a hard-coded randomly generated uuid. Long uuid = _bootstrapTables.get(name); if (uuid == null) { return null; // Unknown table } TableOptions options = new TableOptionsBuilder().setPlacement(_systemTablePlacement).build(); Map<String, Object> attributes = ImmutableMap.of(); TableAvailability availability = new TableAvailability(_systemTablePlacement, false); AstyanaxStorage storage = newAstyanaxStorage(uuid, LEGACY_SHARDS_LOG2, true, _systemTablePlacement, name); Supplier<Collection<DataCenter>> dcSupplier = getDataCentersSupplier(_systemTablePlacement, null); return new AstyanaxTable(name, options, attributes, availability, storage, ImmutableList.of(storage), dcSupplier); }
@Nullable private Table loadBootstrapTable(String name) { // Each system table uses a hard-coded randomly generated uuid. Long uuid = _bootstrapTables.get(name); if (uuid == null) { return null; // Unknown table } TableOptions options = new TableOptionsBuilder().setPlacement(_systemTablePlacement).build(); Map<String, Object> attributes = ImmutableMap.of(); TableAvailability availability = new TableAvailability(_systemTablePlacement, false); AstyanaxStorage storage = newAstyanaxStorage(uuid, LEGACY_SHARDS_LOG2, true, _systemTablePlacement, name); Supplier<Collection<DataCenter>> dcSupplier = getDataCentersSupplier(_systemTablePlacement, null); return new AstyanaxTable(name, options, attributes, availability, storage, ImmutableList.of(storage), dcSupplier); }
private Table newTable(String name, TableOptions options, Map<String, Object> attributes, boolean available, Storage storage) { TableAvailability availability = available ? new TableAvailability(storage.getPlacement(), storage.isFacade()) : null; // Reads are performed using placement and table uuid of the specified storage. AstyanaxStorage read = newAstyanaxStorage(storage, name); // If there's a move in progress, writes go to both the regular location and the move destination. List<AstyanaxStorage> write = Lists.newArrayList(); write.add(read); // Usual case. for (Storage mirrorTo : storage.getMirrors()) { write.add(newAstyanaxStorage(mirrorTo, name)); // When a move is in progress. } // Data centers for facade = all dc in the placement - dc of the master placement. String excludePlacement = storage.isFacade() ? options.getPlacement() : null; Supplier<Collection<DataCenter>> dcSupplier = getDataCentersSupplier(storage.getPlacement(), excludePlacement); return new AstyanaxTable(name, options, attributes, availability, read, write, dcSupplier); }
private Table newTable(String name, TableOptions options, Map<String, Object> attributes, boolean available, Storage storage) { TableAvailability availability = available ? new TableAvailability(storage.getPlacement(), storage.isFacade()) : null; // Reads are performed using placement and table uuid of the specified storage. AstyanaxStorage read = newAstyanaxStorage(storage, name); // If there's a move in progress, writes go to both the regular location and the move destination. List<AstyanaxStorage> write = Lists.newArrayList(); write.add(read); // Usual case. for (Storage mirrorTo : storage.getMirrors()) { write.add(newAstyanaxStorage(mirrorTo, name)); // When a move is in progress. } // Data centers for facade = all dc in the placement - dc of the master placement. String excludePlacement = storage.isFacade() ? options.getPlacement() : null; Supplier<Collection<DataCenter>> dcSupplier = getDataCentersSupplier(storage.getPlacement(), excludePlacement); return new AstyanaxTable(name, options, attributes, availability, read, write, dcSupplier); }