@Override @VisibleForTesting public void validate() { super.validate(); Preconditions.checkNotNull(table, "Actual table is required."); if (cache == null) { Preconditions.checkNotNull(readTtl, "readTtl must be specified."); } else { Preconditions.checkArgument(readTtl == null && writeTtl == null && cacheSize == 0, "Invalid to specify both {cache} and {readTtl|writeTtl|cacheSize} at the same time."); } } }
final void addTableDescriptor(TableDescriptor tableDescriptor) { String tableId = tableDescriptor.getTableId(); Preconditions.checkState(StringUtils.isNotBlank(tableId) && ID_PATTERN.matcher(tableId).matches(), String.format("tableId: %s must confirm to pattern: %s", tableId, ID_PATTERN.toString())); Preconditions.checkState(!tableDescriptors.containsKey(tableId) || tableDescriptors.get(tableId) == tableDescriptor, String.format("Cannot add multiple table descriptors with the same tableId: %s", tableId)); if (tableDescriptor instanceof BaseHybridTableDescriptor) { List<? extends TableDescriptor> tableDescs = ((BaseHybridTableDescriptor) tableDescriptor).getTableDescriptors(); tableDescs.forEach(td -> addTableDescriptor(td)); } tableDescriptors.put(tableId, tableDescriptor); }
final void addTableDescriptor(TableDescriptor tableDescriptor) { String tableId = tableDescriptor.getTableId(); Preconditions.checkState(StringUtils.isNotBlank(tableId) && ID_PATTERN.matcher(tableId).matches(), String.format("tableId: %s must confirm to pattern: %s", tableId, ID_PATTERN.toString())); Preconditions.checkState(!tableDescriptors.containsKey(tableId) || tableDescriptors.get(tableId) == tableDescriptor, String.format("Cannot add multiple table descriptors with the same tableId: %s", tableId)); if (tableDescriptor instanceof BaseHybridTableDescriptor) { List<? extends TableDescriptor> tableDescs = ((BaseHybridTableDescriptor) tableDescriptor).getTableDescriptors(); tableDescs.forEach(td -> addTableDescriptor(td)); } tableDescriptors.put(tableId, tableDescriptor); }
@Override @VisibleForTesting public void validate() { super.validate(); Preconditions.checkNotNull(table, "Actual table is required."); if (cache == null) { Preconditions.checkNotNull(readTtl, "readTtl must be specified."); } else { Preconditions.checkArgument(readTtl == null && writeTtl == null && cacheSize == 0, "Invalid to specify both {cache} and {readTtl|writeTtl|cacheSize} at the same time."); } } }
final void addTableDescriptor(TableDescriptor tableDescriptor) { String tableId = tableDescriptor.getTableId(); Preconditions.checkState(StringUtils.isNotBlank(tableId) && ID_PATTERN.matcher(tableId).matches(), String.format("tableId: %s must confirm to pattern: %s", tableId, ID_PATTERN.toString())); Preconditions.checkState(!tableDescriptors.containsKey(tableId) || tableDescriptors.get(tableId) == tableDescriptor, String.format("Cannot add multiple table descriptors with the same tableId: %s", tableId)); if (tableDescriptor instanceof BaseHybridTableDescriptor) { List<? extends TableDescriptor> tableDescs = ((BaseHybridTableDescriptor) tableDescriptor).getTableDescriptors(); tableDescs.forEach(td -> addTableDescriptor(td)); } tableDescriptors.put(tableId, tableDescriptor); }
@Override @VisibleForTesting public void validate() { super.validate(); Preconditions.checkNotNull(table, "Actual table is required."); if (cache == null) { Preconditions.checkNotNull(readTtl, "readTtl must be specified."); } else { Preconditions.checkArgument(readTtl == null && writeTtl == null && cacheSize == 0, "Invalid to specify both {cache} and {readTtl|writeTtl|cacheSize} at the same time."); } } }
final void addTableDescriptor(TableDescriptor tableDescriptor) { String tableId = tableDescriptor.getTableId(); Preconditions.checkState(StringUtils.isNotBlank(tableId) && ID_PATTERN.matcher(tableId).matches(), String.format("tableId: %s must confirm to pattern: %s", tableId, ID_PATTERN.toString())); Preconditions.checkState(!tableDescriptors.containsKey(tableId) || tableDescriptors.get(tableId) == tableDescriptor, String.format("Cannot add multiple table descriptors with the same tableId: %s", tableId)); if (tableDescriptor instanceof BaseHybridTableDescriptor) { List<? extends TableDescriptor> tableDescs = ((BaseHybridTableDescriptor) tableDescriptor).getTableDescriptors(); tableDescs.forEach(td -> addTableDescriptor(td)); } tableDescriptors.put(tableId, tableDescriptor); }
@Override @VisibleForTesting public void validate() { super.validate(); Preconditions.checkNotNull(table, "Actual table is required."); if (cache == null) { Preconditions.checkNotNull(readTtl, "readTtl must be specified."); } else { Preconditions.checkArgument(readTtl == null && writeTtl == null && cacheSize == 0, "Invalid to specify both {cache} and {readTtl|writeTtl|cacheSize} at the same time."); } } }