Commit c6096bc9 authored by James Hughes's avatar James Hughes
Browse files

Add background operations

parent c3b5e37b
Loading
Loading
Loading
Loading
+546 −548
Original line number Diff line number Diff line
@@ -16,11 +16,9 @@
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 */
package com.seagate.kinetic.proto;
 */ package com.seagate.kinetic.proto;

option java_outer_classname = "Kinetic";
/**
option java_outer_classname = "Kinetic"; /**
 * Update summary:
 *
 * 1. Message is divided into the following logical sections.
@@ -31,8 +29,7 @@ option java_outer_classname = "Kinetic";
 * 1.4 value.
 * 1.5 HMAC.
 *
 */
message Message {
 */ message Message {

// The command contains the header, body and status as a single
// unit that will be used to calculate the HMAC.
@@ -100,10 +97,17 @@ message Message {
		// returned.
		optional bool earlyExit = 10;

    // A hint that this request is part of a background scan, this is a hint that can allow the drive
    // to do it's background read process on this record. This allows the drive not to do it's own
    // background scan.
    optional bool backgroundScan = 11;
		// Priority is a simple integer that determines the priority of this
		// request. All activity at a higher priority will execute before that
		// of lower priority traffic. A higher number is higher priority.
		optional Priority priority = 12;

		// A hint of how long a job should run before yielding. Specified in
		// miliseconds. A value of 0 indicates that the operation can perform one
		// sub operation and then check to see if there are other sub higher
		// priority operations. An example of a sub-operation might be a single put
		// in a P2P operation, etc.
		optional int64 TimeQuanta = 13;
	}

	//message body
@@ -145,7 +149,6 @@ message Message {
			//  for a P2P operation, there was a reason the list was incomplete. This is for items
			// that were not attempted.
			NOT_ATTEMPTED = 0;

			SUCCESS = 1;
			HMAC_FAILURE = 2;
			NOT_AUTHORIZED = 3;
@@ -228,7 +231,6 @@ message Message {
		// write or delete operations, if this is set, the command is rejected.
		optional bool metadataOnly = 7;


		// Synchronization allows the puts and deletes to determine if they are to be
		// WRITETHROUGH: This request is made persistent before returning. This does not effect any other pending operations.
		// WRITEBACK: They can be made persistent when the drive chooses, or when a subsequent FLUSH is give to the drive.
@@ -292,7 +294,6 @@ message Message {
		optional bool firmwareDownload = 5;
	}


	// P2P operations allow drives to be able to send keys to other drives.
	// this is either a standalone command or added to a put command.
	message P2POperation {
@@ -307,7 +308,6 @@ message Message {
		// error cases.
		// When true, no further error checking should be required.
		optional bool allChildOperationsSucceeded = 3;

		message Operation {
		// the key of the entry to move
			optional bytes key = 3;
@@ -332,6 +332,7 @@ message Message {
			optional int32 port = 2;
			optional bool tls = 3;
		}

	}

	//get log
@@ -357,7 +358,6 @@ message Message {
		optional bytes messages = 7;
		optional Limits limits = 8;
		optional Device device = 9;

		message Utilization {

		// The name of the utilization being reported. These names can be standard and proprietary. The
@@ -425,13 +425,13 @@ message Message {
			// these are the port numbers for the software
			optional int32 port = 10;
			optional int32 tlsPort = 11;

			message Interface {
				optional string name = 1;
				optional bytes MAC = 2;
				optional bytes ipv4Address = 3;
				optional bytes ipv6Address = 4;
			}

		}

		// These numbers start at 0 when the drive starts up and never wraps or resets.
@@ -486,7 +486,6 @@ message Message {
			// then no checking occurs. If one or more is specified, one must match or the request
			// is rejected
			repeated Scope scope = 4;

			enum HMACAlgorithm {
				INVALID_HMAC_ALGORITHM = -1; // Must come first, so default is invalid
				// 0 is reserved; do not use
@@ -512,10 +511,22 @@ message Message {
				SECURITY = 8; // can set up the security roles of the device
			}

			// The maxPriority is checked against the header priority and range
			// priority (if present) fields. The priority must be greater than
			// or equal to this maxPriority field.
			optional Priority maxPriority = 5;
		}

	}

	enum Priority {
		NORMAL = 5;
		LOWEST = 1;
		LOWER = 3;
		HIGHER = 7;
		HIGHEST = 9;
	}

	//algorithm
	enum Algorithm {
		INVALID_ALGORITHM = -1; // Must come first, so default is invalid
@@ -531,47 +542,34 @@ message Message {
	//operation code
	enum MessageType {
		INVALID_MESSAGE_TYPE = -1; // Must come first, so default is invalid

		GET = 2; //get operation
		GET_RESPONSE = 1;

		PUT = 4; //put operation
		PUT_RESPONSE = 3;

		DELETE = 6;
		DELETE_RESPONSE = 5;

		GETNEXT = 8;
		GETNEXT_RESPONSE = 7;

		GETPREVIOUS = 10;
		GETPREVIOUS_RESPONSE = 9;

		GETKEYRANGE = 12;
		GETKEYRANGE_RESPONSE = 11;

		// 13 and 14 are reserved, do not use

		GETVERSION = 16;
		GETVERSION_RESPONSE = 15;

		// 17, 18, 19, and 20 are reserved, do not use

		SETUP = 22;
		SETUP_RESPONSE = 21;

		GETLOG = 24;
		GETLOG_RESPONSE = 23;

		SECURITY = 26;
		SECURITY_RESPONSE = 25;

		PEER2PEERPUSH = 28; //peer to peer push operation
		PEER2PEERPUSH_RESPONSE = 27;

		NOOP = 30;
		NOOP_RESPONSE = 29;

		FLUSHALLDATA = 32;
		FLUSHALLDATA_RESPONSE = 31;
	}