private void joinMutationState(Map<TableRef, MultiRowMutationState> srcMutations, Map<TableRef, MultiRowMutationState> dstMutations) { // Merge newMutation with this one, keeping state from newMutation for any overlaps for (Map.Entry<TableRef, MultiRowMutationState> entry : srcMutations.entrySet()) { // Replace existing entries for the table with new entries TableRef tableRef = entry.getKey(); MultiRowMutationState srcRows = entry.getValue(); joinMutationState(tableRef, srcRows, dstMutations); } }
/** * Combine a newer mutation with this one, where in the event of overlaps, the newer one will take precedence. * Combine any metrics collected for the newer mutation. * * @param newMutationState * the newer mutation state */ public void join(MutationState newMutationState) throws SQLException { if (this == newMutationState) { // Doesn't make sense return; } phoenixTransactionContext.join(newMutationState.getPhoenixTransactionContext()); this.sizeOffset += newMutationState.sizeOffset; joinMutationState(newMutationState.mutations, this.mutations); if (!newMutationState.txMutations.isEmpty()) { if (txMutations.isEmpty()) { txMutations = Maps.newHashMapWithExpectedSize(mutations.size()); } joinMutationState(newMutationState.txMutations, this.txMutations); } mutationMetricQueue.combineMetricQueues(newMutationState.mutationMetricQueue); if (readMetricQueue == null) { readMetricQueue = newMutationState.readMetricQueue; } else if (readMetricQueue != null && newMutationState.readMetricQueue != null) { readMetricQueue.combineReadMetrics(newMutationState.readMetricQueue); } throwIfTooBig(); }
joinMutationState(new TableRef(tableRef), multiRowMutationState, txMutations);
private void joinMutationState(Map<TableRef, MultiRowMutationState> srcMutations, Map<TableRef, MultiRowMutationState> dstMutations) { // Merge newMutation with this one, keeping state from newMutation for any overlaps for (Map.Entry<TableRef, MultiRowMutationState> entry : srcMutations.entrySet()) { // Replace existing entries for the table with new entries TableRef tableRef = entry.getKey(); MultiRowMutationState srcRows = entry.getValue(); joinMutationState(tableRef, srcRows, dstMutations); } }
private void joinMutationState(Map<TableRef, MultiRowMutationState> srcMutations, Map<TableRef, MultiRowMutationState> dstMutations) { // Merge newMutation with this one, keeping state from newMutation for any overlaps for (Map.Entry<TableRef, MultiRowMutationState> entry : srcMutations.entrySet()) { // Replace existing entries for the table with new entries TableRef tableRef = entry.getKey(); MultiRowMutationState srcRows = entry.getValue(); joinMutationState(tableRef, srcRows, dstMutations); } }
/** * Combine a newer mutation with this one, where in the event of overlaps, the newer one will take precedence. * Combine any metrics collected for the newer mutation. * * @param newMutationState * the newer mutation state */ public void join(MutationState newMutationState) throws SQLException { if (this == newMutationState) { // Doesn't make sense return; } phoenixTransactionContext.join(newMutationState.getPhoenixTransactionContext()); this.sizeOffset += newMutationState.sizeOffset; joinMutationState(newMutationState.mutations, this.mutations); if (!newMutationState.txMutations.isEmpty()) { if (txMutations.isEmpty()) { txMutations = Maps.newHashMapWithExpectedSize(mutations.size()); } joinMutationState(newMutationState.txMutations, this.txMutations); } mutationMetricQueue.combineMetricQueues(newMutationState.mutationMetricQueue); if (readMetricQueue == null) { readMetricQueue = newMutationState.readMetricQueue; } else if (readMetricQueue != null && newMutationState.readMetricQueue != null) { readMetricQueue.combineReadMetrics(newMutationState.readMetricQueue); } throwIfTooBig(); }
/** * Combine a newer mutation with this one, where in the event of overlaps, the newer one will take precedence. * Combine any metrics collected for the newer mutation. * * @param newMutationState * the newer mutation state */ public void join(MutationState newMutationState) throws SQLException { if (this == newMutationState) { // Doesn't make sense return; } phoenixTransactionContext.join(newMutationState.getPhoenixTransactionContext()); this.sizeOffset += newMutationState.sizeOffset; joinMutationState(newMutationState.mutations, this.mutations); if (!newMutationState.txMutations.isEmpty()) { if (txMutations.isEmpty()) { txMutations = Maps.newHashMapWithExpectedSize(mutations.size()); } joinMutationState(newMutationState.txMutations, this.txMutations); } mutationMetricQueue.combineMetricQueues(newMutationState.mutationMetricQueue); if (readMetricQueue == null) { readMetricQueue = newMutationState.readMetricQueue; } else if (readMetricQueue != null && newMutationState.readMetricQueue != null) { readMetricQueue.combineReadMetrics(newMutationState.readMetricQueue); } throwIfTooBig(); }
joinMutationState(new TableRef(tableRef), multiRowMutationState, txMutations);
joinMutationState(new TableRef(tableRef), multiRowMutationState, txMutations);