@Override public void setWeakNotification(Bytes row, Column col) { checkIfOpen(); Objects.requireNonNull(row); Objects.requireNonNull(col); if (!env.getConfiguredObservers().getObservedColumns(WEAK).contains(col)) { throw new IllegalArgumentException("Column not configured for weak notifications " + col); } env.getSharedResources().getVisCache().validate(col); Set<Column> columns = weakNotifications.get(row); if (columns == null) { columns = new HashSet<>(); weakNotifications.put(row, columns); } columns.add(col); }
static ColumnVisibility gv(Environment env, Column col) { return env.getSharedResources().getVisCache().getCV(col); }
@Override public void setWeakNotification(Bytes row, Column col) { checkIfOpen(); Objects.requireNonNull(row); Objects.requireNonNull(col); if (!env.getConfiguredObservers().getObservedColumns(WEAK).contains(col)) { throw new IllegalArgumentException("Column not configured for weak notifications " + col); } env.getSharedResources().getVisCache().validate(col); Set<Column> columns = weakNotifications.get(row); if (columns == null) { columns = new HashSet<>(); weakNotifications.put(row, columns); } columns.add(col); }
static ColumnVisibility gv(Environment env, Column col) { return env.getSharedResources().getVisCache().getCV(col); }
@Override public Map<Bytes, Map<Column, Bytes>> get(Collection<Bytes> rows, Set<Column> columns) { checkIfOpen(); if (rows.isEmpty() || columns.isEmpty()) { return Collections.emptyMap(); } env.getSharedResources().getVisCache().validate(columns); ParallelSnapshotScanner pss = new ParallelSnapshotScanner(rows, columns, env, startTs, stats, readLocksSeen); Map<Bytes, Map<Column, Bytes>> ret = pss.scan(); for (Entry<Bytes, Map<Column, Bytes>> entry : ret.entrySet()) { updateColumnsRead(entry.getKey(), entry.getValue().keySet()); } return ret; }
@Override public Map<Bytes, Map<Column, Bytes>> get(Collection<Bytes> rows, Set<Column> columns) { checkIfOpen(); if (rows.size() == 0 || columns.size() == 0) { return Collections.emptyMap(); } env.getSharedResources().getVisCache().validate(columns); ParallelSnapshotScanner pss = new ParallelSnapshotScanner(rows, columns, env, startTs, stats, readLocksSeen); Map<Bytes, Map<Column, Bytes>> ret = pss.scan(); for (Entry<Bytes, Map<Column, Bytes>> entry : ret.entrySet()) { updateColumnsRead(entry.getKey(), entry.getValue().keySet()); } return ret; }
@Override public void set(Bytes row, Column col, Bytes value) throws AlreadySetException { checkIfOpen(); Objects.requireNonNull(row); Objects.requireNonNull(col); Objects.requireNonNull(value); 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)) { throw new AlreadySetException("Value already set " + row + " " + col); } colUpdates.put(col, value); }
@Override public void set(Bytes row, Column col, Bytes value) throws AlreadySetException { checkIfOpen(); Objects.requireNonNull(row); Objects.requireNonNull(col); Objects.requireNonNull(value); 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)) { throw new AlreadySetException("Value already set " + row + " " + col); } colUpdates.put(col, value); }
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); }
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); }
public static void put(Environment env, Mutation m, Column col, long ts) { ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(col); m.put(NOTIFY_CF_ARRAY, encodeCol(col), cv, encodeTs(ts, false), TransactionImpl.EMPTY); }
public static void put(Environment env, Mutation m, Column col, long ts) { ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(col); m.put(NOTIFY_CF_ARRAY, encodeCol(col), cv, encodeTs(ts, false), TransactionImpl.EMPTY); }
env.getSharedResources().getVisCache().validate(columns);
env.getSharedResources().getVisCache().validate(columns);
public FluoCondition(Environment env, Column col) { super(ByteUtil.toByteSequence(col.getFamily()), ByteUtil.toByteSequence(col.getQualifier())); if (col.getVisibility().length() > 0) { setVisibility(env.getSharedResources().getVisCache().getCV(col)); } }
public FluoCondition(Environment env, Column col) { super(ByteUtil.toByteSequence(col.getFamily()), ByteUtil.toByteSequence(col.getQualifier())); if (col.getVisibility().length() > 0) { setVisibility(env.getSharedResources().getVisCache().getCV(col)); } }
public Flutation newDelete(Environment env, long ts) { Flutation m = new Flutation(env, rowCol.getRow()); ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(rowCol.getColumn()); m.put(NOTIFY_CF_ARRAY, encodeCol(rowCol.getColumn()), cv, encodeTs(ts, true), TransactionImpl.EMPTY); return m; }
public Flutation newDelete(Environment env, long ts) { Flutation m = new Flutation(env, rowCol.getRow()); ColumnVisibility cv = env.getSharedResources().getVisCache().getCV(rowCol.getColumn()); m.put(NOTIFY_CF_ARRAY, encodeCol(rowCol.getColumn()), cv, encodeTs(ts, true), TransactionImpl.EMPTY); return m; }
public static void put(Environment env, Mutation m, Column col, long ts, byte[] val) { ColumnVisibility cv; if (env != null) { cv = env.getSharedResources().getVisCache().getCV(col.getVisibility()); } else if (col.getVisibility().length() == 0) { cv = VisibilityCache.EMPTY_VIS; } else { cv = new ColumnVisibility(ByteUtil.toText(col.getVisibility())); } m.put(col.getFamily().toArray(), col.getQualifier().toArray(), cv, ts, val); } }
public static void put(Environment env, Mutation m, Column col, long ts, byte[] val) { ColumnVisibility cv; if (env != null) { cv = env.getSharedResources().getVisCache().getCV(col.getVisibility()); } else if (col.getVisibility().length() == 0) { cv = VisibilityCache.EMPTY_VIS; } else { cv = new ColumnVisibility(ByteUtil.toText(col.getVisibility())); } m.put(col.getFamily().toArray(), col.getQualifier().toArray(), cv, ts, val); } }