Examples of toJsonBytes()


Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

                }

                // Reserve blobs so no other records can use them
                reserveBlobs(null, referencedBlobs);

                put.add(RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes, recordEvent.toJsonBytes());
                boolean success = recordTable.checkAndPut(put.getRow(), RecordCf.DATA.bytes, RecordColumn.OCC.bytes,
                        oldOccBytes, put);
                if (!success) {
                    throw new RecordExistsException(recordId);
                }
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

                    unReferencedBlobs, useLatestRecordType, fieldTypes)) {

                // Reserve blobs so no other records can use them
                reserveBlobs(record.getId(), referencedBlobs);

                put.add(RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes, recordEvent.toJsonBytes());
                put.add(RecordCf.DATA.bytes, RecordColumn.OCC.bytes, 1L, nextOcc(oldOccBytes));
                boolean occSuccess = recordTable.checkAndPut(put.getRow(), RecordCf.DATA.bytes, RecordColumn.OCC.bytes,
                        oldOccBytes, put);
                if (!occSuccess) {
                    throw new ConcurrentRecordUpdateException(recordId);
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

                validateRecord(newRecord, originalRecord, recordType, fieldTypes);

                // Reserve blobs so no other records can use them
                reserveBlobs(record.getId(), referencedBlobs);

                put.add(RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes, 1L, recordEvent.toJsonBytes());
                put.add(RecordCf.DATA.bytes, RecordColumn.OCC.bytes, 1L, nextOcc(oldOccBytes));
                boolean occSuccess = recordTable.checkAndPut(put.getRow(), RecordCf.DATA.bytes, RecordColumn.OCC.bytes,
                        oldOccBytes, put);
                if (!occSuccess) {
                    throw new ConcurrentRecordUpdateException(recordId);
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

                    put.add(RecordCf.DATA.bytes, fieldType.getQualifier(), 1L, FieldFlags.getDeleteMarker());
                }

            }

            put.add(RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes, recordEvent.toJsonBytes());
            put.add(RecordCf.DATA.bytes, RecordColumn.OCC.bytes, 1L, nextOcc(oldOcc));

            // Hint towards the NGDATA HBase authorization coprocessor: for deletes, we need write access to all
            // columns, since otherwise we could end up with half-deleted records. The default behavior for puts
            // is to silently filter columns from the Put for which the user has no write permission.
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

        if (record.getId() == null) {
            record.setId(getIdGenerator().newRecordId());
        }
        Put put = hbaseRepo.buildPut(record, 1L, fieldTypes, recordEvent, Sets.<BlobReference>newHashSet(),
                Sets.<BlobReference>newHashSet(), 1L);
        put.add(LilyHBaseSchema.RecordCf.DATA.bytes, LilyHBaseSchema.RecordColumn.PAYLOAD.bytes, recordEvent.toJsonBytes());
        return put;
    }

    /**
     * Build a {@code Put} to update a record. No metadata updates are performed, and any existing metadata on the
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

        filterData.setSubscriptionInclusions(ImmutableSet.of("SomeOtherIndexName"));
        recordEvent.setIndexRecordFilterData(filterData);

        WALEdit walEdit = new WALEdit();
        walEdit.add(new KeyValue(Bytes.toBytes("row"), RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes,
                recordEvent.toJsonBytes()));

        editFilter.apply(walEdit);

        assertEquals(0, walEdit.size());
    }
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

        filterData.setSubscriptionInclusions(ImmutableSet.of(INDEX_NAME));
        recordEvent.setIndexRecordFilterData(filterData);

        WALEdit walEdit = new WALEdit();
        walEdit.add(new KeyValue(Bytes.toBytes("row"), RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes,
                recordEvent.toJsonBytes()));

        editFilter.apply(walEdit);

        assertEquals(1, walEdit.size());
    }
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

        recordEvent.setIndexRecordFilterData(filterData);
        recordEvent.getAttributes().put(IndexerEditFilter.NO_INDEX_FLAG, "false");

        WALEdit walEdit = new WALEdit();
        walEdit.add(new KeyValue(Bytes.toBytes("row"), RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes,
                recordEvent.toJsonBytes()));

        editFilter.apply(walEdit);

        assertEquals(0, walEdit.size());
    }
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

                    Bytes.add(new byte[]{LilyHBaseSchema.RecordColumn.DATA_PREFIX}, fieldType.getId().getBytes()),
                    output.toByteArray()));
        }
       
        // fields to delete, should we add these too?
        kvs.add(new KeyValue(rowKey, family, LilyHBaseSchema.RecordColumn.PAYLOAD.bytes, event.toJsonBytes()));

        return new Result(kvs);
    }

    private static class FakeSolrUpdateWriter implements SolrUpdateWriter {
View Full Code Here

Examples of org.lilyproject.util.repo.RecordEvent.toJsonBytes()

            filterData.setSubscriptionInclusions(ImmutableSet.of(this.subscriptionId));
            payload.setIndexRecordFilterData(filterData);

            try {
                eventPublisherManager.getEventPublisher(repo, referrer.getTable()
                ).publishEvent(referrer.getRecordId().toBytes(), payload.toJsonBytes());
            } catch (Exception e) {
                // We failed to put the message: this is pretty important since it means the record's index
                // won't get updated, therefore log as error, but after this we continue with the next one.
                log.error("Error putting index message on queue of record " + referrer, e);
                //metrics.errors.inc();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.