@Override public String toString() { // Intentionally not redacting the row key to make this more useful. return "Row error for primary key=" + Bytes.pretty(operation.getRow().encodePrimaryKey()) + ", tablet=" + operation.getTablet() + ", server=" + tsUUID + ", status=" + status.toString(); }
@Override void updateStatistics(Statistics statistics, OperationResponse response) { String tabletId = this.getTablet().getTabletId(); String tableName = this.getTable().getName(); TabletStatistics tabletStatistics = statistics.getTabletStatistics(tableName, tabletId); if (response == null) { tabletStatistics.incrementStatistic(Statistic.OPS_ERRORS, 1); tabletStatistics.incrementStatistic(Statistic.RPC_ERRORS, 1); return; } tabletStatistics.incrementStatistic(Statistic.WRITE_RPCS, 1); if (response.hasRowError()) { // If ignoreAllDuplicateRows is set, the already_present exception will be // discarded and wont't be recorded here tabletStatistics.incrementStatistic(Statistic.OPS_ERRORS, 1); } else { tabletStatistics.incrementStatistic(Statistic.WRITE_OPS, 1); } tabletStatistics.incrementStatistic(Statistic.BYTES_WRITTEN, getRowOperationSizeBytes()); }
@Override Message createRequestPB() { final Tserver.WriteRequestPB.Builder builder = createAndFillWriteRequestPB(ImmutableList.of(this)); this.rowOperationSizeBytes = (long)builder.getRowOperations().getRows().size() + (long)builder.getRowOperations().getIndirectData().size(); builder.setTabletId(UnsafeByteOperations.unsafeWrap(getTablet().getTabletIdAsBytes())); builder.setExternalConsistencyMode(this.externalConsistencyMode.pbVersion()); if (this.propagatedTimestamp != AsyncKuduClient.NO_TIMESTAMP) { builder.setPropagatedTimestamp(this.propagatedTimestamp); } return builder.build(); }