private void buildKey(DecoratedKey key) { ReadQuery selectQuery = view.getReadQuery(); if (!selectQuery.selectsKey(key)) { logger.trace("Skipping {}, view query filters", key); return; } int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand command = view.getSelectStatement().internalReadForView(key, nowInSec); // We're rebuilding everything from what's on disk, so we read everything, consider that as new updates // and pretend that there is nothing pre-existing. UnfilteredRowIterator empty = UnfilteredRowIterators.noRowsIterator(baseCfs.metadata, key, Rows.EMPTY_STATIC_ROW, DeletionTime.LIVE, false); try (ReadExecutionController orderGroup = command.executionController(); UnfilteredRowIterator data = UnfilteredPartitionIterators.getOnlyElement(command.executeLocally(orderGroup), command)) { Iterator<Collection<Mutation>> mutations = baseCfs.keyspace.viewManager .forTable(baseCfs.metadata) .generateViewUpdates(Collections.singleton(view), data, empty, nowInSec, true); AtomicLong noBase = new AtomicLong(Long.MAX_VALUE); mutations.forEachRemaining(m -> StorageProxy.mutateMV(key.getKey(), m, true, noBase, System.nanoTime())); } }
private void buildKey(DecoratedKey key) { ReadQuery selectQuery = view.getReadQuery(); if (!selectQuery.selectsKey(key)) { logger.trace("Skipping {}, view query filters", key); return; } int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand command = view.getSelectStatement().internalReadForView(key, nowInSec); // We're rebuilding everything from what's on disk, so we read everything, consider that as new updates // and pretend that there is nothing pre-existing. UnfilteredRowIterator empty = UnfilteredRowIterators.noRowsIterator(baseCfs.metadata, key, Rows.EMPTY_STATIC_ROW, DeletionTime.LIVE, false); try (ReadExecutionController orderGroup = command.executionController(); UnfilteredRowIterator data = UnfilteredPartitionIterators.getOnlyElement(command.executeLocally(orderGroup), command)) { Iterator<Collection<Mutation>> mutations = baseCfs.keyspace.viewManager .forTable(baseCfs.metadata) .generateViewUpdates(Collections.singleton(view), data, empty, nowInSec, true); AtomicLong noBase = new AtomicLong(Long.MAX_VALUE); mutations.forEachRemaining(m -> StorageProxy.mutateMV(key.getKey(), m, true, noBase, System.nanoTime())); } }
private void buildKey(DecoratedKey key) { ReadQuery selectQuery = view.getReadQuery(); if (!selectQuery.selectsKey(key)) { logger.trace("Skipping {}, view query filters", key); return; } int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand command = view.getSelectStatement().internalReadForView(key, nowInSec); // We're rebuilding everything from what's on disk, so we read everything, consider that as new updates // and pretend that there is nothing pre-existing. UnfilteredRowIterator empty = UnfilteredRowIterators.noRowsIterator(baseCfs.metadata, key, Rows.EMPTY_STATIC_ROW, DeletionTime.LIVE, false); try (ReadExecutionController orderGroup = command.executionController(); UnfilteredRowIterator data = UnfilteredPartitionIterators.getOnlyElement(command.executeLocally(orderGroup), command)) { Iterator<Collection<Mutation>> mutations = baseCfs.keyspace.viewManager .forTable(baseCfs.metadata) .generateViewUpdates(Collections.singleton(view), data, empty, nowInSec, true); AtomicLong noBase = new AtomicLong(Long.MAX_VALUE); mutations.forEachRemaining(m -> StorageProxy.mutateMV(key.getKey(), m, true, noBase, System.nanoTime())); } }
Collection<Mutation> mutations; try (ReadExecutionController orderGroup = command.executionController(); UnfilteredRowIterator existings = UnfilteredPartitionIterators.getOnlyElement(command.executeLocally(orderGroup), command); UnfilteredRowIterator updates = update.unfilteredIterator())
Collection<Mutation> mutations; try (ReadExecutionController orderGroup = command.executionController(); UnfilteredRowIterator existings = UnfilteredPartitionIterators.getOnlyElement(command.executeLocally(orderGroup), command); UnfilteredRowIterator updates = update.unfilteredIterator())
Collection<Mutation> mutations; try (ReadExecutionController orderGroup = command.executionController(); UnfilteredRowIterator existings = UnfilteredPartitionIterators.getOnlyElement(command.executeLocally(orderGroup), command); UnfilteredRowIterator updates = update.unfilteredIterator())
return UnfilteredPartitionIterators.getOnlyElement(executeReadCommand(cmd), cmd);
return UnfilteredPartitionIterators.getOnlyElement(executeReadCommand(cmd), cmd);
return UnfilteredPartitionIterators.getOnlyElement(executeReadCommand(cmd), cmd);