Java Code Examples for com.sleepycat.bind.tuple.TupleOutput#writeLong()

The following examples show how to use com.sleepycat.bind.tuple.TupleOutput#writeLong() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UpgradeFrom5To6.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
private void writeRecords(NewRecordImpl[] records, TupleOutput output)
{
    if (records == null)
    {
        output.writeInt(0);
    }
    else
    {
        output.writeInt(records.length);
        for (NewRecordImpl record : records)
        {
            UUID id = record.getId();
            output.writeLong(id.getMostSignificantBits());
            output.writeLong(id.getLeastSignificantBits());
            output.writeLong(record.getMessageNumber());
        }
    }
}
 
Example 2
Source File: UpgradeFrom5To6.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
private void writeRecords(OldRecordImpl[] records, TupleOutput output)
{
    if (records == null)
    {
        output.writeInt(0);
    }
    else
    {
        output.writeInt(records.length);
        for (OldRecordImpl record : records)
        {
            output.writeString(record.getQueueName());
            output.writeLong(record.getMessageNumber());
        }
    }
}
 
Example 3
Source File: PreparedTransactionBinding.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
private static void writeRecords(Transaction.EnqueueRecord[] records, TupleOutput output)
{
    if(records == null)
    {
        output.writeInt(0);
    }
    else
    {
        output.writeInt(records.length);
        for(Transaction.EnqueueRecord record : records)
        {
            UUID id = record.getResource().getId();
            output.writeLong(id.getMostSignificantBits());
            output.writeLong(id.getLeastSignificantBits());
            output.writeLong(record.getMessage().getMessageNumber());
        }
    }
}
 
Example 4
Source File: PreparedTransactionBinding.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
private static void writeRecords(Transaction.DequeueRecord[] records, TupleOutput output)
{
    if(records == null)
    {
        output.writeInt(0);
    }
    else
    {
        output.writeInt(records.length);
        for(Transaction.DequeueRecord record : records)
        {
            UUID id = record.getEnqueueRecord().getQueueId();
            output.writeLong(id.getMostSignificantBits());
            output.writeLong(id.getLeastSignificantBits());
            output.writeLong(record.getEnqueueRecord().getMessageNumber());
        }
    }
}
 
Example 5
Source File: XidBinding.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
@Override
public void objectToEntry(Xid xid, TupleOutput output)
{
    output.writeLong(xid.getFormat());
    output.writeInt(xid.getGlobalId() == null ? 0 : xid.getGlobalId().length);
    if(xid.getGlobalId() != null)
    {
        output.write(xid.getGlobalId());
    }
    output.writeInt(xid.getBranchId() == null ? 0 : xid.getBranchId().length);
    if(xid.getBranchId() != null)
    {
        output.write(xid.getBranchId());
    }

}
 
Example 6
Source File: UpgradeFrom7To8.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
void storeVirtualHostHierarchyRecord(Database hierarchyDb, Transaction txn, UUID id, UUID virtualHostId)
{
    DatabaseEntry key = new DatabaseEntry();
    DatabaseEntry value = new DatabaseEntry();
    UUIDTupleBinding.getInstance().objectToEntry(virtualHostId, value);
    TupleOutput tupleOutput = new TupleOutput();
    tupleOutput.writeLong(id.getMostSignificantBits());
    tupleOutput.writeLong(id.getLeastSignificantBits());
    tupleOutput.writeString("VirtualHost");
    TupleBinding.outputToEntry(tupleOutput, key);
    hierarchyDb.put(txn, key, value);
}
 
Example 7
Source File: UpgradeFrom5To6.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public void objectToEntry(NewQueueEntryKey mk, TupleOutput tupleOutput)
{
    UUID uuid = mk.getQueueId();
    tupleOutput.writeLong(uuid.getMostSignificantBits());
    tupleOutput.writeLong(uuid.getLeastSignificantBits());
    tupleOutput.writeLong(mk.getMessageId());
}
 
Example 8
Source File: UpgradeFrom4To5.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public void objectToEntry(MessageContentKey object, TupleOutput tupleOutput)
{
    final MessageContentKey mk = object;
    tupleOutput.writeLong(mk.getMessageId());
    tupleOutput.writeInt(mk.getChunk());
}
 
Example 9
Source File: HierarchyKeyBinding.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
@Override
public void objectToEntry(HierarchyKey hk, TupleOutput tupleOutput)
{
    UUID uuid = hk.getChildId();
    tupleOutput.writeLong(uuid.getMostSignificantBits());
    tupleOutput.writeLong(uuid.getLeastSignificantBits());
    tupleOutput.writeString(hk.getParentType());
}
 
Example 10
Source File: OrphanConfigurationRecordPurger.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
private TupleOutput uuidToKey(final UUID uuid)
{
    DatabaseEntry key = new DatabaseEntry();
    TupleOutput output = new TupleOutput();
    output.writeLong(uuid.getMostSignificantBits());
    output.writeLong(uuid.getLeastSignificantBits());
    return output;
}
 
Example 11
Source File: FieldTableEncoding.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
public  static void writeFieldTable(FieldTable fieldTable, TupleOutput tupleOutput)
{

    if (fieldTable == null)
    {
        tupleOutput.writeLong(0);
    }
    else
    {
        tupleOutput.writeLong(fieldTable.getEncodedSize());
        tupleOutput.writeFast(fieldTable.getDataAsBytes());
    }
}
 
Example 12
Source File: UpgradeFrom5To6.java    From qpid-broker-j with Apache License 2.0 4 votes vote down vote up
@Override
public void objectToEntry(final CompoundKey object, final TupleOutput output)
{
    output.writeLong(object._messageId);
    output.writeInt(object._offset);
}
 
Example 13
Source File: UpgradeFrom5To6.java    From qpid-broker-j with Apache License 2.0 4 votes vote down vote up
@Override
public void objectToEntry(final UUID uuid, final TupleOutput tupleOutput)
{
    tupleOutput.writeLong(uuid.getMostSignificantBits());
    tupleOutput.writeLong(uuid.getLeastSignificantBits());
}
 
Example 14
Source File: UpgradeFrom5To6.java    From qpid-broker-j with Apache License 2.0 4 votes vote down vote up
@Override
public void objectToEntry(OldQueueEntryKey mk, TupleOutput tupleOutput)
{
    AMQShortStringEncoding.writeShortString(mk.getQueueName(), tupleOutput);
    tupleOutput.writeLong(mk.getMessageId());
}
 
Example 15
Source File: UpgradeFrom4To5.java    From qpid-broker-j with Apache License 2.0 4 votes vote down vote up
@Override
public void objectToEntry(QueueEntryKey mk, TupleOutput tupleOutput)
{
    AMQShortStringEncoding.writeShortString(mk.getQueueName(), tupleOutput);
    tupleOutput.writeLong(mk.getMessageId());
}
 
Example 16
Source File: UUIDTupleBinding.java    From qpid-broker-j with Apache License 2.0 4 votes vote down vote up
@Override
public void objectToEntry(final UUID uuid, final TupleOutput tupleOutput)
{
    tupleOutput.writeLong(uuid.getMostSignificantBits());
    tupleOutput.writeLong(uuid.getLeastSignificantBits());
}