/** * Get list of table specs given a list of table descriptors. * @param tableDescs the list of tableDescriptors * @return list of tableSpecs */ static public List<TableSpec> getTableSpecs(List<TableDescriptor> tableDescs) { Map<TableSpec, TableImpl> tableSpecs = new LinkedHashMap<>(); tableDescs.forEach(tableDesc -> { TableSpec tableSpec = ((BaseTableDescriptor) tableDesc).getTableSpec(); if (tableSpecs.containsKey(tableSpec)) { throw new IllegalStateException( String.format("getTable() invoked multiple times with the same tableId: %s", tableDesc.getTableId())); } tableSpecs.put(tableSpec, new TableImpl(tableSpec)); }); return new ArrayList<>(tableSpecs.keySet()); } }
/** * Get list of table specs given a list of table descriptors. * @param tableDescs the list of tableDescriptors * @return list of tableSpecs */ static public List<TableSpec> getTableSpecs(List<TableDescriptor> tableDescs) { Map<TableSpec, TableImpl> tableSpecs = new LinkedHashMap<>(); tableDescs.forEach(tableDesc -> { TableSpec tableSpec = ((BaseTableDescriptor) tableDesc).getTableSpec(); if (tableSpecs.containsKey(tableSpec)) { throw new IllegalStateException( String.format("getTable() invoked multiple times with the same tableId: %s", tableDesc.getTableId())); } tableSpecs.put(tableSpec, new TableImpl(tableSpec)); }); return new ArrayList<>(tableSpecs.keySet()); } }
/** * Get list of table specs given a list of table descriptors. * @param tableDescs the list of tableDescriptors * @return list of tableSpecs */ static public List<TableSpec> getTableSpecs(List<TableDescriptor> tableDescs) { Map<TableSpec, TableImpl> tableSpecs = new LinkedHashMap<>(); tableDescs.forEach(tableDesc -> { TableSpec tableSpec = ((BaseTableDescriptor) tableDesc).getTableSpec(); if (tableSpecs.containsKey(tableSpec)) { throw new IllegalStateException( String.format("getTable() invoked multiple times with the same tableId: %s", tableDesc.getTableId())); } tableSpecs.put(tableSpec, new TableImpl(tableSpec)); }); return new ArrayList<>(tableSpecs.keySet()); } }
/** * Get list of table specs given a list of table descriptors. * @param tableDescs the list of tableDescriptors * @return list of tableSpecs */ static public List<TableSpec> getTableSpecs(List<TableDescriptor> tableDescs) { Map<TableSpec, TableImpl> tableSpecs = new LinkedHashMap<>(); tableDescs.forEach(tableDesc -> { TableSpec tableSpec = ((BaseTableDescriptor) tableDesc).getTableSpec(); if (tableSpecs.containsKey(tableSpec)) { throw new IllegalStateException( String.format("getTable() invoked multiple times with the same tableId: %s", tableDesc.getTableId())); } tableSpecs.put(tableSpec, new TableImpl(tableSpec)); }); return new ArrayList<>(tableSpecs.keySet()); } }
@Override public TableSpec getTableSpec() { validate(); Map<String, String> tableSpecConfig = new HashMap<>(); generateTableSpecConfig(tableSpecConfig); if (cache != null) { tableSpecConfig.put(CachingTableProvider.CACHE_TABLE_ID, ((BaseTableDescriptor) cache).getTableSpec().getId()); } else { if (readTtl != null) { tableSpecConfig.put(CachingTableProvider.READ_TTL_MS, String.valueOf(readTtl.toMillis())); } if (writeTtl != null) { tableSpecConfig.put(CachingTableProvider.WRITE_TTL_MS, String.valueOf(writeTtl.toMillis())); } if (cacheSize > 0) { tableSpecConfig.put(CachingTableProvider.CACHE_SIZE, String.valueOf(cacheSize)); } } tableSpecConfig.put(CachingTableProvider.REAL_TABLE_ID, ((BaseTableDescriptor) table).getTableSpec().getId()); tableSpecConfig.put(CachingTableProvider.WRITE_AROUND, String.valueOf(isWriteAround)); return new TableSpec(tableId, serde, CachingTableProviderFactory.class.getName(), tableSpecConfig); }
@Override public TableSpec getTableSpec() { validate(); Map<String, String> tableSpecConfig = new HashMap<>(); generateTableSpecConfig(tableSpecConfig); if (cache != null) { tableSpecConfig.put(CachingTableProvider.CACHE_TABLE_ID, ((BaseTableDescriptor) cache).getTableSpec().getId()); } else { if (readTtl != null) { tableSpecConfig.put(CachingTableProvider.READ_TTL_MS, String.valueOf(readTtl.toMillis())); } if (writeTtl != null) { tableSpecConfig.put(CachingTableProvider.WRITE_TTL_MS, String.valueOf(writeTtl.toMillis())); } if (cacheSize > 0) { tableSpecConfig.put(CachingTableProvider.CACHE_SIZE, String.valueOf(cacheSize)); } } tableSpecConfig.put(CachingTableProvider.REAL_TABLE_ID, ((BaseTableDescriptor) table).getTableSpec().getId()); tableSpecConfig.put(CachingTableProvider.WRITE_AROUND, String.valueOf(isWriteAround)); return new TableSpec(tableId, serde, CachingTableProviderFactory.class.getName(), tableSpecConfig); }
@Override public TableSpec getTableSpec() { validate(); Map<String, String> tableSpecConfig = new HashMap<>(); generateTableSpecConfig(tableSpecConfig); if (cache != null) { tableSpecConfig.put(CachingTableProvider.CACHE_TABLE_ID, ((BaseTableDescriptor) cache).getTableSpec().getId()); } else { if (readTtl != null) { tableSpecConfig.put(CachingTableProvider.READ_TTL_MS, String.valueOf(readTtl.toMillis())); } if (writeTtl != null) { tableSpecConfig.put(CachingTableProvider.WRITE_TTL_MS, String.valueOf(writeTtl.toMillis())); } if (cacheSize > 0) { tableSpecConfig.put(CachingTableProvider.CACHE_SIZE, String.valueOf(cacheSize)); } } tableSpecConfig.put(CachingTableProvider.REAL_TABLE_ID, ((BaseTableDescriptor) table).getTableSpec().getId()); tableSpecConfig.put(CachingTableProvider.WRITE_AROUND, String.valueOf(isWriteAround)); return new TableSpec(tableId, serde, CachingTableProviderFactory.class.getName(), tableSpecConfig); }
@Override public TableSpec getTableSpec() { validate(); Map<String, String> tableSpecConfig = new HashMap<>(); generateTableSpecConfig(tableSpecConfig); if (cache != null) { tableSpecConfig.put(CachingTableProvider.CACHE_TABLE_ID, ((BaseTableDescriptor) cache).getTableSpec().getId()); } else { if (readTtl != null) { tableSpecConfig.put(CachingTableProvider.READ_TTL_MS, String.valueOf(readTtl.toMillis())); } if (writeTtl != null) { tableSpecConfig.put(CachingTableProvider.WRITE_TTL_MS, String.valueOf(writeTtl.toMillis())); } if (cacheSize > 0) { tableSpecConfig.put(CachingTableProvider.CACHE_SIZE, String.valueOf(cacheSize)); } } tableSpecConfig.put(CachingTableProvider.REAL_TABLE_ID, ((BaseTableDescriptor) table).getTableSpec().getId()); tableSpecConfig.put(CachingTableProvider.WRITE_AROUND, String.valueOf(isWriteAround)); return new TableSpec(tableId, serde, CachingTableProviderFactory.class.getName(), tableSpecConfig); }
@Override public <K, V> Table<KV<K, V>> getTable(TableDescriptor<K, V, ?> tableDescriptor) { addTableDescriptor(tableDescriptor); BaseTableDescriptor baseTableDescriptor = (BaseTableDescriptor) tableDescriptor; getOrCreateTableSerdes(baseTableDescriptor.getTableId(), baseTableDescriptor.getSerde()); return new TableImpl(baseTableDescriptor.getTableSpec()); }
@Override public <K, V> Table<KV<K, V>> getTable(TableDescriptor<K, V, ?> tableDescriptor) { addTableDescriptor(tableDescriptor); BaseTableDescriptor baseTableDescriptor = (BaseTableDescriptor) tableDescriptor; getOrCreateTableSerdes(baseTableDescriptor.getTableId(), baseTableDescriptor.getSerde()); return new TableImpl(baseTableDescriptor.getTableSpec()); }
@Override public <K, V> Table<KV<K, V>> getTable(TableDescriptor<K, V, ?> tableDescriptor) { addTableDescriptor(tableDescriptor); BaseTableDescriptor baseTableDescriptor = (BaseTableDescriptor) tableDescriptor; getOrCreateTableSerdes(baseTableDescriptor.getTableId(), baseTableDescriptor.getSerde()); return new TableImpl(baseTableDescriptor.getTableSpec()); }
@Override public <K, V> Table<KV<K, V>> getTable(TableDescriptor<K, V, ?> tableDescriptor) { addTableDescriptor(tableDescriptor); BaseTableDescriptor baseTableDescriptor = (BaseTableDescriptor) tableDescriptor; getOrCreateTableSerdes(baseTableDescriptor.getTableId(), baseTableDescriptor.getSerde()); return new TableImpl(baseTableDescriptor.getTableSpec()); }
.map(tableDescriptor -> ((BaseTableDescriptor) tableDescriptor).getTableSpec()).collect(Collectors.toSet());
.map(tableDescriptor -> ((BaseTableDescriptor) tableDescriptor).getTableSpec()).collect(Collectors.toSet());
.map(tableDescriptor -> ((BaseTableDescriptor) tableDescriptor).getTableSpec()).collect(Collectors.toSet());
.map(tableDescriptor -> ((BaseTableDescriptor) tableDescriptor).getTableSpec()).collect(Collectors.toSet());