public ColumnValueFilter(final byte[] family, final byte[] qualifier, final CompareOperator op, final ByteArrayComparable comparator) { this.family = Preconditions.checkNotNull(family, "family should not be null."); this.qualifier = qualifier == null ? new byte[0] : qualifier; this.op = Preconditions.checkNotNull(op, "CompareOperator should not be null"); this.comparator = Preconditions.checkNotNull(comparator, "Comparator should not be null"); }
@Override public void setKey(Key key) { Preconditions.checkNotNull(key, "Key cannot be null"); this.key = key; }
@Override public CheckAndMutateBuilder ifMatches(CompareOperator compareOp, byte[] value) { this.op = Preconditions.checkNotNull(compareOp, "compareOp is null"); this.value = Preconditions.checkNotNull(value, "value is null"); return this; }
public CoprocessorServiceBuilderImpl(Function<RpcChannel, S> stubMaker, ServiceCaller<S, R> callable, CoprocessorCallback<R> callback) { this.stubMaker = Preconditions.checkNotNull(stubMaker, "stubMaker is null"); this.callable = Preconditions.checkNotNull(callable, "callable is null"); this.callback = Preconditions.checkNotNull(callback, "callback is null"); }
@Override public CheckAndMutateBuilder qualifier(byte[] qualifier) { this.qualifier = Preconditions.checkNotNull(qualifier, "qualifier is null. Consider using" + " an empty byte array, or just do not call this method if you want a null qualifier"); return this; }
public WriterFactory withComparator(CellComparator comparator) { Preconditions.checkNotNull(comparator); this.comparator = comparator; return this; }
@Override public void setKey(Key key) { Preconditions.checkNotNull(key, "Key cannot be null"); this.key = key; }
public Builder withComparator(CellComparator comparator) { Preconditions.checkNotNull(comparator); this.comparator = comparator; return this; }
@Override public CheckAndMutateBuilder ifMatches(CompareOperator compareOp, byte[] value) { if (compareOp == CompareOperator.EQUAL) { this.value = Preconditions.checkNotNull(value, "value is null"); return this; } else { throw new UnsupportedOperationException("CheckAndMutate for non-equal comparison " + "not implemented"); } }
@Override public CompletableFuture<Void> compactRegion(byte[] regionName, byte[] columnFamily) { Preconditions.checkNotNull(columnFamily, "columnFamily is null." + " If you don't specify a columnFamily, use compactRegion(regionName) instead"); return compactRegion(regionName, columnFamily, false); }
@Override public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern) { Preconditions.checkNotNull(tableNamePattern, "tableNamePattern is null." + " If you don't specify a tableNamePattern, use deleteSnapshots() instead"); return internalDeleteSnapshots(tableNamePattern, null); }
@Override public OutputStream createEncryptionStream(OutputStream out, Encryptor e) throws IOException { Preconditions.checkNotNull(e); return e.createEncryptionStream(out); }
@Override public void callMethod(Descriptors.MethodDescriptor md, RpcController controller, Message param, Message returnType, RpcCallback<Message> done) { // This method does not throw any exceptions, so the caller must provide a // HBaseRpcController which is used to pass the exceptions. this.rpcClient.callMethod(md, configureRpcController(Preconditions.checkNotNull(controller, "RpcController can not be null for async rpc call")), param, returnType, ticket, addr, done); } }
@Override public void setIv(byte[] iv) { Preconditions.checkNotNull(iv, "IV cannot be null"); Preconditions.checkArgument(iv.length == AES.IV_LENGTH, "Invalid IV length"); this.iv = iv; }
@Override public CompletableFuture<List<SnapshotDescription>> listSnapshots(Pattern pattern) { Preconditions.checkNotNull(pattern, "pattern is null. If you don't specify a pattern, use listSnapshots() instead"); return getCompletedSnapshots(pattern); }
@Override public InputStream createDecryptionStream(InputStream in, Decryptor d) throws IOException { Preconditions.checkNotNull(d); return d.createDecryptionStream(in); }
/** * {@link #listTableDescriptors(boolean)} */ @Override public CompletableFuture<List<TableDescriptor>> listTableDescriptors(Pattern pattern, boolean includeSysTables) { Preconditions.checkNotNull(pattern, "pattern is null. If you don't specify a pattern, use listTables(boolean) instead"); return getTableDescriptors(RequestConverter.buildGetTableDescriptorsRequest(pattern, includeSysTables)); }
@Override public OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv) throws IOException { Preconditions.checkNotNull(context); Preconditions.checkState(context.getKey() != null, "Context does not have a key"); Preconditions.checkNotNull(iv); Encryptor e = getEncryptor(); e.setKey(context.getKey()); e.setIv(iv); return e.createEncryptionStream(out); }
@Override public void run() { Preconditions.checkNotNull(server); if (server.isStopped() || (region.getTableDescriptor() != null && !region.getTableDescriptor().isCompactionEnabled())) { region.decrementCompactionsQueuedCount(); return; } doCompaction(user); }
@Override public CompletableFuture<Void> createTable(TableDescriptor desc, byte[][] splitKeys) { Preconditions.checkNotNull(splitKeys, "splitKeys is null. If you don't specify splitKeys," + " use createTable(TableDescriptor) instead"); try { verifySplitKeys(splitKeys); return createTable(desc.getTableName(), RequestConverter.buildCreateTableRequest(desc, splitKeys, ng.getNonceGroup(), ng.newNonce())); } catch (IllegalArgumentException e) { return failedFuture(e); } }