Commit 1c522532 authored by chiaming2000's avatar chiaming2000
Browse files

Merge pull request #27 from Seagate/features/batch-operation

Features/batch operation
parents 6b5c98a2 2ed9a7c2
Loading
Loading
Loading
Loading
+42 −2
Original line number Diff line number Diff line
@@ -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";
@@ -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.
@@ -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
@@ -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
@@ -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;
		}

	}
@@ -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
@@ -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;
	}

}