Package com.foundationdb.subspace

Examples of com.foundationdb.subspace.Subspace


            default:
                selector = new ProtobufWriter.SingleSchemaSelector(schema);
        }

        if(newAIS.getSchema(schema) != null) {
            Subspace blobDir = dir.createOrOpen(txn.getTransaction(), PathUtil.from(schema)).get();
            buffer = serialize(buffer, newAIS, selector);
            byte[] newValue;
            if((buffer.position() == 0) && (buffer.limit() == buffer.capacity())) {
                newValue = buffer.array();
            } else {
View Full Code Here


    private void loadProtobufChildren(TransactionState txn, DirectorySubspace dir, ProtobufReader reader, Collection<String> skip) {
        for(String subDirName : dir.list(txn.getTransaction()).get()) {
            if((skip != null) && skip.contains(subDirName)) {
                continue;
            }
            Subspace subDir = dir.open(txn.getTransaction(), PathUtil.from(subDirName)).get();
            BlobAsync blob = new BlobAsync(subDir);
            byte[] data = blob.read(txn.getTransaction()).get();
            if(data != null) {
                ByteBuffer buffer = ByteBuffer.wrap(data);
                reader.loadBuffer(buffer);
View Full Code Here

            prefix = configService.getProperty(CONFIG_PREFIX).getBytes("ISO-8859-1");
        }
        catch (UnsupportedEncodingException ex) {
            throw new AkibanInternalException("Error encoding prefix", ex);
        }
        dataSubspace = new Subspace(tupleFrom(METRIC_KEY), prefix);
        confSubspace = new Subspace(tupleFrom(METRIC_CONF_KEY), prefix);
        confChangesSubspace = new Subspace(tupleFrom(METRIC_CONF_CHANGES_KEY), prefix);
        // NOTE: Java does not expose a nanosecond wallclock timer, like POSIX
        // CLOCK_REALTIME, only one like CLOCK_MONOTONIC. (Among other things, 64 bits is
        // only 292 years.) There is a tradeoff between using synchronized clocks in a
        // multi-node environment and using clocks that NTP doesn't change so that
        // small-scale deltas are always accurate.  fdbserver metrics choose the former.
View Full Code Here

                byte[] afterPrefix = ByteArrayUtil.join(dir.pack(), new byte[] { 0x43 });

                tr.set(beforePrefix, beforePrefix);
                tr.set(afterPrefix, afterPrefix);

                BlobAsync blob = new BlobAsync(new Subspace(blobPrefix));
                blob.write(tr, 0, testBytes).get();

                byte[] readBytes = blob.read(tr).get();
                assertArrayEquals(testBytes, readBytes);
View Full Code Here

TOP

Related Classes of com.foundationdb.subspace.Subspace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.