Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Independent timestamps for each cell in puts, multiple column familes in get/put/delete #76

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/AtomicIncrementRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ public byte[] family() {
return family;
}

@Override
public byte[][] getFamilies() {
return new byte[][] { family };
}

@Override
public byte[] qualifier() {
return qualifier;
Expand Down
35 changes: 28 additions & 7 deletions src/BatchableRpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ abstract class BatchableRpc extends HBaseRpc
// So instead we make them package-private so that subclasses can still
// access them directly.

/** Family affected by this RPC. */
/*protected*/ final byte[] family;
/** Families affected by this RPC. */
/*protected*/ final byte[][] families;

/** The timestamp to use for {@link KeyValue}s of this RPC. */
/*protected*/ final long timestamp;
Expand All @@ -72,16 +72,16 @@ abstract class BatchableRpc extends HBaseRpc
* Package private constructor.
* @param table The name of the table this RPC is for.
* @param row The name of the row this RPC is for.
* @param family The column family to edit in that table. Subclass must
* validate, this class doesn't perform any validation on the family.
* @param families The column families to edit in that table. Subclass must
* validate, this class doesn't perform any validation on the families.
* @param timestamp The timestamp to use for {@link KeyValue}s of this RPC.
* @param lockid Explicit row lock to use, or {@link RowLock#NO_LOCK}.
*/
BatchableRpc(final byte[] table,
final byte[] key, final byte[] family,
final byte[] key, final byte[][] families,
final long timestamp, final long lockid) {
super(table, key);
this.family = family;
this.families = families;
this.timestamp = timestamp;
this.lockid = lockid;
}
Expand Down Expand Up @@ -116,7 +116,12 @@ public final void setDurable(final boolean durable) {

@Override
public final byte[] family() {
return family;
return families == null ? null : families[0];
}

@Override
public final byte[][] getFamilies() {
return families;
}

@Override
Expand Down Expand Up @@ -156,18 +161,34 @@ final boolean canBuffer() {

/**
* How many {@link KeyValue}s will be serialized by {@link #serializePayload}.
* Used with RPCs with single column families.
*/
abstract int numKeyValues();

/**
* An estimate of the number of bytes needed for {@link #serializePayload}.
* The estimate is conservative.
* Used with RPCs with single column families.
*/
abstract int payloadSize();

/**
* Serialize the part of this RPC for a {@link MultiAction}.
* Used with RPCs with single column families.
*/
abstract void serializePayload(final ChannelBuffer buf);

/**
* An estimate of the number of bytes needed for {@link #serializePayloads}.
* The estimate is conservative.
* Used with RPCs with multiple column families.
*/
abstract int payloadsSize();

/**
* Serialize the part of this RPC for a {@link MultiAction}.
* Used with RPCs with multiple column families.
*/
abstract void serializePayloads(final ChannelBuffer buf);

}
5 changes: 5 additions & 0 deletions src/CompareAndSetRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ public byte[] family() {
return put.family();
}

@Override
public byte[][] getFamilies() {
return put.getFamilies();
}

@Override
public byte[] qualifier() {
return put.qualifier();
Expand Down
Loading