/** {@inheritDoc} */ @Override protected void cleanup() { ResourceUtils.releaseOrLog(mTable); ResourceUtils.releaseOrLog(mFiji); }
/** * @return a default clock instance that uses the system clock. */ public static Clock getDefaultClock() { return new DefaultClock(); } }
/** * Serializes a long integer into bytes using the zig-zag variable-length encoding scheme. * * @param number Long integer to encode. * @return Zig-zag encoded long, as an array of up to 10 bytes. */ public static byte[] longToZigZagVarInt64(long number) { // Zig-zag encode: move sign to low-order bit, and flip others if negative number = (number << 1) ^ (number >> 63); return longToVarInt64(number); }
@Override public void close(boolean abort) throws IOException { ResourceUtils.closeOrLog(mFijiTableWriter); ResourceUtils.releaseOrLog(mFijiTable); ResourceUtils.releaseOrLog(mFiji); }
/** * Close all underlying resources. */ @Override public void close() { ResourceUtils.closeOrLog(mConsoleReader); } }
@Override public String toString() { return ByteArrayFormatter.toHex(mBytes, ':'); } }
/** * Validates a name (table name, locality group name, family name, or column name). * * @param name The name to validate. * @return whether the name is valid. */ private static boolean isValidName(String name) { return FijiNameValidator.isValidLayoutName(name); }
/** * Reads a table import mapping descriptor from its JSON serialized form. * * @param json JSON string. * @return the decoded table layout descriptor. * @throws IOException on I/O error. */ public static TableImportDescriptorDesc readTableImportDescriptorDescFromJSON(String json) throws IOException { final TableImportDescriptorDesc desc = (TableImportDescriptorDesc) FromJson.fromJsonString(json, TableImportDescriptorDesc.SCHEMA$); return desc; }
/** * Reads a variable-length zig-zag encoded signed integer up to 64 bits. * * @return the read integer as a long. * @throws EncodingException on decoding error. */ public long readZigZagVarInt64() throws EncodingException { final long vint64 = readVarInt64(); return (vint64 >>> 1) ^ -(vint64 & 1); // decode zig-zag back to two's-complement }
/** * Validates an alias (table name, locality group name, family name, or column name). * * @param alias The alias to validate. * @return whether the alias is valid. */ private static boolean isValidAlias(String alias) { return FijiNameValidator.isValidAlias(alias); }
/** * Constructor. * @param table The table connection to wrap. * @param pool The pool that this Connection is associated with. */ public PooledFijiTable(FijiTable table, Pool pool) { mTable = table; mPool = pool; mLastAccessTime = pool.getClock().getTime(); }
/** * Constructs a new instance. * * @param causes identifying the compatibilities of each schema pair. */ public SchemaSetCompatibility(List<SchemaPairCompatibility> causes) { SchemaCompatibilityType isCompatible = SchemaCompatibilityType.COMPATIBLE; for (SchemaPairCompatibility compatibility : causes) { if (compatibility.getType() == SchemaCompatibilityType.INCOMPATIBLE) { isCompatible = SchemaCompatibilityType.INCOMPATIBLE; break; } } mType = isCompatible; mCauses = causes; }
/** * Creates a FijiTablePoolBuilder with for the specified Fiji instance and the default options. * * @param fiji TableFactory to be used for constructing tables for the table pool. A fiji * instance is the normal source for this. */ FijiTablePoolBuilder(FijiTableFactory fiji) { mFijiTableFactory = fiji; mMinSize = DEFAULT_MIN_POOL_SIZE; mMaxSize = DEFAULT_MAX_POOL_SIZE; mIdleTimeout = DEFAULT_IDLE_TIMEOUT; mIdlePollPeriod = DEFAULT_IDLE_POLL_PERIOD; mClock = Clock.getDefaultClock(); }
/** {@inheritDoc} */ @Override public void close() throws IOException { ResourceUtils.closeOrLog(mCurrentPagedFijiRowDataWritable); ResourceUtils.closeOrLog(mScanner); ResourceUtils.closeOrLog(mFijiTableReader); ResourceUtils.releaseOrLog(mFijiTable); ResourceUtils.releaseOrLog(mFiji); }
/** * Releases the underlying connection to the Fiji table. */ public void releaseUnderlyingFijiTable() { ResourceUtils.releaseOrLog(mTable); }
/** * Validates a name (table name, locality group name, family name, or column name). * * @param name The name to validateDestination. * @return whether the name is valid. */ private static boolean isValidName(String name) { return FijiNameValidator.isValidLayoutName(name); }
/** {@inheritDoc} */ @Override public void close() throws IOException { ResourceUtils.closeOrLog(mScanner); ResourceUtils.closeOrLog(mReader); ResourceUtils.releaseOrLog(mTable); ResourceUtils.releaseOrLog(mFiji); mIterator = null; mScanner = null; mReader = null; mTable = null; mFiji = null; mSplit = null; mCurrentRow = null; } }
/** {@inheritDoc} */ @Override protected void cleanup() throws IOException { ResourceUtils.releaseOrLog(mTable); ResourceUtils.releaseOrLog(mFiji); mTableURI = null; mTable = null; mFiji = null; }
/** {@inheritDoc} */ @Override public void close() throws IOException { ResourceUtils.closeOrLog(mScanner); ResourceUtils.closeOrLog(mReader); ResourceUtils.releaseOrLog(mTable); ResourceUtils.releaseOrLog(mFiji); mIterator = null; mScanner = null; mReader = null; mTable = null; mFiji = null; mSplit = null; mCurrentRow = null; } }
/** {@inheritDoc} */ @Override public void close() throws IOException { ResourceUtils.releaseOrLog(mFijiTable); ResourceUtils.releaseOrLog(mFiji); } }