@Override public void create(String name, TableOptions options, Map<String, ?> attributes, Audit audit) { // Check that the table doesn't yet exist. Long existingUuid = _nameToUuid.get(name); if (existingUuid != null) { Table existingTable = _uuidToTable.get(existingUuid); if (existingTable.getOptions().getPlacement().equals(options.getPlacement()) && existingTable.getAttributes().equals(attributes)) { // Allow re-creating a table with no changes as a way of forcing a global cache flush. return; } else { throw new TableExistsException(format("Cannot create table that already exists: %s", name), name); } } long newUuid = Hashing.murmur3_128().hashUnencodedChars(name).asLong(); while (_uuidToTable.containsKey(newUuid) || newUuid == -1) { newUuid += 1; } _nameToUuid.put(name, newUuid); _uuidToTable.put(newUuid, new InMemoryTable(name, options, Maps.newHashMap(attributes))); }
TableExistsException.class.getName().equals(exceptionType)) { if (response.hasEntity()) { return (RuntimeException) response.getEntity(TableExistsException.class).initCause(e); } else { return (RuntimeException) new TableExistsException().initCause(e);
TableExistsException.class.getName().equals(exceptionType)) { if (response.hasEntity()) { return (RuntimeException) response.getEntity(TableExistsException.class).initCause(e); } else { return (RuntimeException) new TableExistsException().initCause(e);
TableExistsException.class.getName().equals(exceptionType)) { if (response.hasEntity()) { return (RuntimeException) response.getEntity(TableExistsException.class).initCause(e); } else { return (RuntimeException) new TableExistsException().initCause(e);
@Override public void create(String name, TableOptions options, Map<String, ?> attributes, Audit audit) { // Check that the table doesn't yet exist. Long existingUuid = _nameToUuid.get(name); if (existingUuid != null) { Table existingTable = _uuidToTable.get(existingUuid); if (existingTable.getOptions().getPlacement().equals(options.getPlacement()) && existingTable.getAttributes().equals(attributes)) { // Allow re-creating a table with no changes as a way of forcing a global cache flush. return; } else { throw new TableExistsException(format("Cannot create table that already exists: %s", name), name); } } long newUuid = Hashing.murmur3_128().hashUnencodedChars(name).asLong(); while (_uuidToTable.containsKey(newUuid) || newUuid == -1) { newUuid += 1; } _nameToUuid.put(name, newUuid); _uuidToTable.put(newUuid, new InMemoryTable(name, options, Maps.newHashMap(attributes))); }
TableExistsException.class.getName().equals(exceptionType)) { if (response.hasEntity()) { return (RuntimeException) response.getEntity(TableExistsException.class).initCause(e); } else { return (RuntimeException) new TableExistsException().initCause(e);
throw new TableExistsException(format("May not modify system tables: %s", name), name); return; // Nothing to do } else { throw new TableExistsException(format("Cannot create table that already exists: %s", name), name);
throw new TableExistsException(format("May not modify system tables: %s", name), name); return; // Nothing to do } else { throw new TableExistsException(format("Cannot create table that already exists: %s", name), name);
if (storageForDc.isFacade()) { throw new TableExistsException(format("Multiple facades found for table %s in %s", name, _selfDataCenter), name);
if (storageForDc.isFacade()) { throw new TableExistsException(format("Multiple facades found for table %s in %s", name, _selfDataCenter), name);