Skip to content

Commit

Permalink
Merge pull request #27 from Seagate/features/batch-operation
Browse files Browse the repository at this point in the history
Features/batch operation
  • Loading branch information
chiaming2000 committed Jul 16, 2015
2 parents 6b5c98a + 2ed9a7c commit 1c52253
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions kinetic.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package com.seagate.kinetic.proto;

option java_outer_classname = "Kinetic";
Expand All @@ -24,7 +23,7 @@ option java_outer_classname = "Kinetic";
// the protocol version number by building this message
// and then reading the value.
message Local {
optional string protocolVersion = 1 [default = "3.0.5"];
optional string protocolVersion = 1 [default = "3.0.6"];
}

// THe message is an authorization and command bytes.
Expand Down Expand Up @@ -156,6 +155,11 @@ message Command {
// priority operations. An example of a sub-operation might be a single put
// in a P2P operation, etc.
optional int64 TimeQuanta = 13;

// batch id to be included in each command of a batch operation
// this id is generated by client library and must be unique
// within the same connection.
optional uint32 batchID = 14;
}

//message body
Expand Down Expand Up @@ -183,6 +187,27 @@ message Command {

// Perform Pin-based operations
optional PinOperation pinOp = 8;

// batch operation
// This is included in the END_BATCH and END_BATCH_RESPONSE.
optional Batch batch = 9;
}

// This is included in the END_BATCH and END_BATCH_RESPONSE.
message Batch {
// set by the client library in END_BATCH request message.
// the total number of operations in the batch
optional int32 count = 1;

// set by the drive in END_BATCH_RESPONSE message.
// If a batch is committed successfully, all sequence Ids of those
// commands (PUT/DELETE) performed in the batch are
// added in the END_BATCH_RESPONSE message.
repeated int64 sequence = 2 [packed=true];

// This field is set by the drive if a batch commit failed.
// The first failed operation sequence in the batch is set as value.
optional int64 failedSequence = 3;
}

//operation status
Expand Down Expand Up @@ -261,6 +286,11 @@ message Command {
// The connection is being terminated. Details as to why are
// in the message string.
CONNECTION_TERMINATED = 20;

// During a batch operation, the only operations allowed are put "
// and delete. This error is put against the offending command and "
// the rest of the commands and the END_BATCH return NOT_ATTEMPTED."
INVALID_BATCH = 21;
}

}
Expand Down Expand Up @@ -525,6 +555,8 @@ message Command {
optional uint32 maxKeyRangeCount = 9;
optional uint32 maxIdentityCount = 10;
optional uint32 maxPinSize = 11;
optional uint32 maxOperationCountPerBatch = 12;
optional uint32 maxBatchCountPerDevice = 13;
}

// The Device GetLog message is to ask the device to send back the
Expand Down Expand Up @@ -702,6 +734,14 @@ message Command {
// could be things accomplished using the media optimize command.
MEDIAOPTIMIZE = 40;
MEDIAOPTIMIZE_RESPONSE = 39;

// batch operations
START_BATCH = 42;
START_BATCH_RESPONSE = 41;
END_BATCH = 44;
END_BATCH_RESPONSE = 43;
ABORT_BATCH = 46;
ABORT_BATCH_RESPONSE = 45;
}

}

0 comments on commit 1c52253

Please sign in to comment.