public CellConflict(Cell cell, long theirStart, long theirCommit) { this.cell = cell; this.cellString = cell.toString(); this.theirStart = theirStart; this.theirCommit = theirCommit; }
private String getMessage(Multimap<Cell, Long> cellTsPairsToSweep) { return cellTsPairsToSweep.entries().stream() .sorted(Comparator.comparing(Map.Entry::getKey)) .map(entry -> entry.getKey().toString() + "->" + entry.getValue()) .collect(Collectors.joining(", ", "[", "]")); } }
public static String getHumanReadableCellName(@Nullable TableMetadata metadata, Cell cell) { if (cell == null) { return "null"; } if (metadata == null) { return cell.toString(); } try { String rowName = metadata.getRowMetadata().renderToJson(cell.getRowName()); String colName; if (metadata.getColumns().hasDynamicColumns()) { colName = metadata.getColumns().getDynamicColumn().getColumnNameDesc().renderToJson( cell.getColumnName()); } else { colName = PtBytes.toString(cell.getColumnName()); } return "Cell [rowName=" + rowName + ", columnName=" + colName + "]"; } catch (Exception e) { log.warn("Failed to render as json", e); return cell.toString(); } } }
public CellConflict(Cell cell, long theirStart, long theirCommit) { this.cell = cell; this.cellString = cell.toString(); this.theirStart = theirStart; this.theirCommit = theirCommit; }
private String getMessage(Multimap<Cell, Long> cellTsPairsToSweep) { return cellTsPairsToSweep.entries().stream() .sorted(Comparator.comparing(Map.Entry::getKey)) .map(entry -> entry.getKey().toString() + "->" + entry.getValue()) .collect(Collectors.joining(", ", "[", "]")); } }
public static String getHumanReadableCellName(@Nullable TableMetadata metadata, Cell cell) { if (cell == null) { return "null"; } if (metadata == null) { return cell.toString(); } try { String rowName = metadata.getRowMetadata().renderToJson(cell.getRowName()); String colName; if (metadata.getColumns().hasDynamicColumns()) { colName = metadata.getColumns().getDynamicColumn().getColumnNameDesc().renderToJson( cell.getColumnName()); } else { colName = PtBytes.toString(cell.getColumnName()); } return "Cell [rowName=" + rowName + ", columnName=" + colName + "]"; } catch (Exception e) { log.warn("Failed to render as json", e); return cell.toString(); } } }