Commit a94d7566 authored by chiaming2000's avatar chiaming2000
Browse files

Added batch operations support.

parent 6b5c98a2
Loading
Loading
Loading
Loading
+34 −11
Original line number Diff line number Diff line
/**
 *
 * Copyright (C) 2014 Seagate Technology.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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 +27,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 +159,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
@@ -261,6 +269,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 +538,8 @@ message Command {
			optional uint32 maxKeyRangeCount = 9;
			optional uint32 maxIdentityCount = 10;
			optional uint32 maxPinSize = 11;
			optional uint32 maxOperationCountPerBatch = 12;
			optional uint32 maxBatchCountPerConnection = 13;
		}

		// The Device GetLog message is to ask the device to send back the
@@ -702,6 +717,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;
	}

}