@Override public void run() { CleanUp.shutdownNow(); } });
/** * Adds a long value to this writer's buffer. The long is encoded as a variable-length list of * bytes. For a description of the encoding scheme, see <code>WritableUtils.writeVLong()</code> * in the Hadoop API. [<a href= * "http://hadoop.apache.org/docs/stable/api/org/apache/hadoop/io/WritableUtils.html#writeVLong%28java.io.DataOutput,%20long%29">link</a>] * * @param i * long value */ public void writeVLong(long i) { reserve(9); offset = UnsynchronizedBuffer.writeVLong(data, offset, i); }
public static HostAndPort parseAddress(String address, int defaultPort) { return parseAddress(address, true).withDefaultPort(defaultPort); }
public SimpleThreadPool(int max, final String name, BlockingQueue<Runnable> queue) { super(max, max, 4L, TimeUnit.SECONDS, queue, new NamingThreadFactory(name)); allowCoreThreadTimeOut(true); }
/** * Create an iterator from an (ordered) sequence of KeyValue pairs. */ public RowIterator(Iterator<Entry<Key,Value>> iterator) { this.iter = new PeekingIterator<>(iterator); }
/** * Constructs a token from a copy of the password. Destroying the argument after construction will * not destroy the copy in this token, and destroying this token will only destroy the copy held * inside this token, not the argument. */ public PasswordToken(ByteBuffer password) { this.password = ByteBufferUtil.toBytes(password); }
private String validateTableNameArgument(ByteBuffer tableNameArg, TableOperation op, Validator<String> userValidator) throws ThriftTableOperationException { String tableName = tableNameArg == null ? null : ByteBufferUtil.toString(tableNameArg); return _validateArgument(tableName, op, VALID_NAME.and(userValidator)); }
public AssignmentTask(Map<Path,List<KeyExtent>> assignmentFailures, String location, Map<KeyExtent,List<PathSize>> assignmentsPerTablet) { this.assignmentFailures = assignmentFailures; this.location = HostAndPort.fromString(location); this.assignmentsPerTablet = assignmentsPerTablet; }
private static void read(DataInput in, MutableByteSequence mbseqDestination, int len) throws IOException { if (mbseqDestination.getBackingArray().length < len) { mbseqDestination.setArray(new byte[UnsynchronizedBuffer.nextArraySize(len)], 0, 0); } in.readFully(mbseqDestination.getBackingArray(), 0, len); mbseqDestination.setLength(len); }
@Override public boolean equals(Object rhsObject) { if (!(rhsObject instanceof SuspendingTServer)) { return false; } SuspendingTServer rhs = (SuspendingTServer) rhsObject; return server.equals(rhs.server) && suspensionTime == rhs.suspensionTime; }
private void serialize() { if (buffer != null) { data = buffer.toArray(); buffer = null; } }
/** * Reads an integer value from this reader's buffer, assuming the integer was encoded as a * variable-length list of bytes. * * @return integer value */ public int readVInt() { return (int) readVLong(); }
/** * Adds an integer value to this writer's buffer. The integer is encoded as a variable-length * list of bytes. See {@link #writeVLong(long)} for a description of the encoding. * * @param i * integer value */ public void writeVInt(int i) { writeVLong(i); }
public SimpleThreadPool(int max, final String name) { super(max, max, 4L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new NamingThreadFactory(name)); allowCoreThreadTimeOut(true); }
@Override public PeekingIterator<Entry<Key,Value>> createValue() { return new PeekingIterator<>(); } };
private String validateNamespaceArgument(ByteBuffer namespaceArg, TableOperation op, Validator<String> userValidator) throws ThriftTableOperationException { String namespace = namespaceArg == null ? null : ByteBufferUtil.toString(namespaceArg); return _validateArgument(namespace, op, Namespaces.VALID_NAME.and(userValidator)); }
@Override public void run() { CleanUp.shutdownNow(); } });
@Override public void run() { CleanUp.shutdownNow(); } });