@Override public boolean equals(Object o) { if (o instanceof PrimaryRowColumn) { PrimaryRowColumn ock = (PrimaryRowColumn) o; return prow.equals(ock.prow) && pcol.equals(ock.pcol) && startTs == ock.startTs; } return false; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof ColumnValue) { ColumnValue ocv = (ColumnValue) o; return column.equals(ocv.column) && val.equals(ocv.val); } return false; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof RowColumn) { RowColumn other = (RowColumn) o; return row.equals(other.row) && col.equals(other.col); } return false; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof ColumnValue) { ColumnValue ocv = (ColumnValue) o; return column.equals(ocv.column) && val.equals(ocv.val); } return false; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof RowColumn) { RowColumn other = (RowColumn) o; return row.equals(other.row) && col.equals(other.col); } return false; }
@Override public boolean equals(Object o) { if (o instanceof PrimaryRowColumn) { PrimaryRowColumn ock = (PrimaryRowColumn) o; return prow.equals(ock.prow) && pcol.equals(ock.pcol) && startTs == ock.startTs; } return false; }
private static boolean diff(String dataType, Bytes expected, Bytes actual) { if (!expected.equals(actual)) { log.error("Difference found in {} - expected {} actual {}", dataType, Hex.encNonAscii(expected), Hex.encNonAscii(actual)); return true; } return false; }
private static RowColumn buildRowColumn(KeyBuilder key) { if (key.infinite || key.row.equals(Bytes.EMPTY)) { return RowColumn.EMPTY; } else if (key.cf.equals(Bytes.EMPTY)) { return new RowColumn(key.row); } else if (key.cq.equals(Bytes.EMPTY)) { return new RowColumn(key.row, new Column(key.cf)); } else if (key.cv.equals(Bytes.EMPTY)) { return new RowColumn(key.row, new Column(key.cf, key.cq)); } return new RowColumn(key.row, new Column(key.cf, key.cq, key.cv)); }
private static RowColumn buildRowColumn(KeyBuilder key) { if (key.infinite || key.row.equals(Bytes.EMPTY)) { return RowColumn.EMPTY; } else if (key.cf.equals(Bytes.EMPTY)) { return new RowColumn(key.row); } else if (key.cq.equals(Bytes.EMPTY)) { return new RowColumn(key.row, new Column(key.cf)); } else if (key.cv.equals(Bytes.EMPTY)) { return new RowColumn(key.row, new Column(key.cf, key.cq)); } return new RowColumn(key.row, new Column(key.cf, key.cq, key.cv)); }
void setReadLock(Bytes row, Column col) { checkIfOpen(); Objects.requireNonNull(row); Objects.requireNonNull(col); if (col.getFamily().equals(ColumnConstants.NOTIFY_CF)) { throw new IllegalArgumentException(ColumnConstants.NOTIFY_CF + " is a reserved family"); } env.getSharedResources().getVisCache().validate(col); Map<Column, Bytes> colUpdates = updates.computeIfAbsent(row, k -> new HashMap<>()); Bytes curVal = colUpdates.get(col); if (curVal != null && (isWrite(curVal) || isDelete(curVal))) { throw new AlreadySetException("Attemped read lock after write lock " + row + " " + col); } colUpdates.put(col, RLOCK_VAL); }
/** * @return Returns input with prefix and hash stripped from beginning. */ public Bytes removeHash(Bytes row) { Preconditions.checkArgument(row.length() >= prefixBytes.length() + 5, "Row is shorter than expected " + row); Preconditions.checkArgument(row.subSequence(0, prefixBytes.length()).equals(prefixBytes), "Row does not have expected prefix " + row); Preconditions.checkArgument(hasHash(row), "Row does not have expected hash " + row); return row.subSequence(prefixBytes.length() + 5, row.length()); }
@Override public boolean equals(Object o) { if (o instanceof Value) { Value ov = (Value) o; if (getBytes() == null) { return ov.getBytes() == null; } else { return getBytes().equals(ov.getBytes()); } } return false; } }
private static boolean isPrimary(PrimaryRowColumn prc, Key k) { return prc.prow.equals(ByteUtil.toBytes(k.getRowData())) && prc.pcol.equals(SpanUtil.toRowColumn(k).getColumn()); }
private static boolean isPrimary(PrimaryRowColumn prc, Key k) { return prc.prow.equals(ByteUtil.toBytes(k.getRowData())) && prc.pcol.equals(SpanUtil.toRowColumn(k).getColumn()); }