Package com.persistit

Examples of com.persistit.Key


                               WriteIndexRow indexRow,
                               SpatialColumnHandler spatialColumnHandler,
                               long zValue,
                               boolean doLock) {
        TransactionState txn = txnService.getTransaction(session);
        Key indexKey = createKey();
        constructIndexRow(session, indexKey, rowData, index, hKey, indexRow, spatialColumnHandler, zValue, false);
        byte[] packed = packedTuple(index, indexKey);
        txn.clearKey(packed);
    }
View Full Code Here


    // KeyCreator
    //

    @Override
    public Key createKey() {
        return new Key(null, 2047);
    }
View Full Code Here

                        SpatialColumnHandler spatialColumnHandler = null;
                        if (index.isSpatial()) {
                            spatialColumnHandler = new SpatialColumnHandler(index);
                            zValue = spatialColumnHandler.zValue(rowData);
                        }
                        Key hKey = store.createKey();
                        row.hKey().copyTo(hKey);
                        store.writeIndexRow(session, index, rowData, hKey, buffer,
                                            spatialColumnHandler, zValue, true);
                    }
                }
View Full Code Here

                        checkers.put(row.rowType(), checker);
                    }
                    try {
                        if(handler != null) {
                            //TODO: Not correct but only option for createAs due to hidden PK
                            Key hKey = new Key (null, 2047);
                            row.hKey().copyTo(hKey);
                            if (!checker.contains(schemaManager, session, hKey)) {
                                handler.handleRow(row);
                            } else {
                                LOG.trace("skipped row: {}", row);
View Full Code Here

    public static byte[] packedTuple(FDBStorageDescription storageDescription, Key key, Key.EdgeValue edge, FDBStoreData.NudgeDir nudged) {
        byte[] treeBytes = prefixBytes(storageDescription);
        if (edge != null) {
            // TODO: Could eliminate new key if callers didn't rely on key state outside getEncodedSize()
            // (see checkUniqueness() in FDBStore).
            Key nkey = new Key(null, key.getEncodedSize() + 1);
            key.copyTo(nkey);
            key = nkey;
            key.append(edge);
        }
        byte[] keyBytes = storageDescription.getKeyBytes(key, nudged);
View Full Code Here

        }

        @Override
        public RuntimeException createException(Session session, TransactionState txn, Index index) {
            // Recover Key for error message.
            Key persistitKey = new Key((Persistit)null);
            FDBStoreDataHelper.unpackTuple(index, persistitKey, bkey);
            String msg = formatIndexRowString(index, persistitKey);
            return new DuplicateKeyException(index.getIndexName(), msg);
        }
View Full Code Here

            }
        }

        @Override
        public RuntimeException createException(Session session, TransactionState txn, Index index) {
            Key persistitKey = new Key((Persistit)null);
            FDBStoreDataHelper.unpackTuple(index, persistitKey, bkey);
            String key = ConstraintHandler.formatKey(session, index, persistitKey,
                                                     foreignKey.getReferencingColumns(),
                                                     foreignKey.getReferencedColumns());
            return new ForeignKeyReferencingViolationException(operation,
View Full Code Here

            return 1;
        }

        @Override
        public RuntimeException createException(Session session, TransactionState txn, Index index) {
            Key persistitKey = new Key((Persistit)null);
            FDBStoreDataHelper.unpackTuple(index, persistitKey, bkey);
            String key = ConstraintHandler.formatKey(session, index, persistitKey,
                                                     foreignKey.getReferencedColumns(),
                                                     foreignKey.getReferencingColumns());
            return new ForeignKeyReferencedViolationException(operation,
View Full Code Here

        }

        @Override
        public boolean check(Session session, TransactionState txn, Index index) {
            try {
                Key persistitKey = null;
                while (iter.hasNext()) {
                    KeyValue kv = iter.next();
                    bkey = kv.getKey();
                    if (persistitKey == null) {
                        persistitKey = new Key((Persistit)null);
                    }
                    FDBStoreDataHelper.unpackTuple(index, persistitKey, bkey);
                    if (!ConstraintHandler.keyHasNullSegments(persistitKey, index)) {
                        return false;
                    }
View Full Code Here

            return true;
        }

        @Override
        public RuntimeException createException(Session session, TransactionState txn, Index index) {
            Key persistitKey = new Key((Persistit)null);
            FDBStoreDataHelper.unpackTuple(index, persistitKey, bkey);
            String key = ConstraintHandler.formatKey(session, index, persistitKey,
                                                     foreignKey.getReferencedColumns(),
                                                     foreignKey.getReferencingColumns());
            return new ForeignKeyReferencedViolationException(operation,
View Full Code Here

TOP

Related Classes of com.persistit.Key

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.