public ScanDispatcher getScanDispatcher() { long count = getUpdateCount(); TablesScanDispatcher currRef = scanDispatcherRef.get(); if (currRef == null || currRef.count != count) { ScanDispatcher newDispatcher = Property.createTableInstanceFromPropertyName(this, Property.TABLE_SCAN_DISPATCHER, ScanDispatcher.class, null); Builder<String,String> builder = ImmutableMap.builder(); getAllPropertiesWithPrefix(Property.TABLE_SCAN_DISPATCHER_OPTS).forEach((k, v) -> { String optKey = k.substring(Property.TABLE_SCAN_DISPATCHER_OPTS.getKey().length()); builder.put(optKey, v); }); Map<String,String> opts = builder.build(); newDispatcher.init(() -> opts); TablesScanDispatcher newRef = new TablesScanDispatcher(newDispatcher, count); scanDispatcherRef.compareAndSet(currRef, newRef); currRef = newRef; } return currRef.dispatcher; } }
CompactionStrategy strategy = Property.createTableInstanceFromPropertyName(tableConf, Property.TABLE_COMPACTION_STRATEGY, CompactionStrategy.class, new DefaultCompactionStrategy());
strategy = Property.createTableInstanceFromPropertyName(tableConfiguration, Property.TABLE_COMPACTION_STRATEGY, CompactionStrategy.class, new DefaultCompactionStrategy());
chooser = tableSpecificChooser.get(env.getTableId()); if (chooser == null) { VolumeChooser temp = Property.createTableInstanceFromPropertyName(tableConf, Property.TABLE_VOLUME_CHOOSER, VolumeChooser.class, fallbackVolumeChooser); chooser = tableSpecificChooser.putIfAbsent(env.getTableId(), temp); VolumeChooser temp = Property.createTableInstanceFromPropertyName(tableConf, Property.TABLE_VOLUME_CHOOSER, VolumeChooser.class, fallbackVolumeChooser); VolumeChooser last = tableSpecificChooser.replace(env.getTableId(), temp);
CompactionStrategy strategy = Property.createTableInstanceFromPropertyName(tableConf, Property.TABLE_COMPACTION_STRATEGY, CompactionStrategy.class, new DefaultCompactionStrategy());
strategy = Property.createTableInstanceFromPropertyName(tableConfiguration, Property.TABLE_COMPACTION_STRATEGY, CompactionStrategy.class, new DefaultCompactionStrategy());