syntax = "proto3";
package event_store.client.operations;
option java_package = "com.eventstore.dbclient.proto.operations";

import "shared.proto";

service Operations {
	rpc StartScavenge (StartScavengeReq) returns (ScavengeResp);
	rpc StopScavenge (StopScavengeReq) returns (ScavengeResp);
	rpc Shutdown (event_store.client.shared.Empty) returns (event_store.client.shared.Empty);
	rpc MergeIndexes (event_store.client.shared.Empty) returns (event_store.client.shared.Empty);
	rpc ResignNode (event_store.client.shared.Empty) returns (event_store.client.shared.Empty);
	rpc SetNodePriority (SetNodePriorityReq) returns (event_store.client.shared.Empty);
}

message StartScavengeReq {
	Options options = 1;
	message Options {
		int32 thread_count = 1;
		int32 start_from_chunk = 2;
	}
}

message StopScavengeReq {
	Options options = 1;
	message Options {
		string scavenge_id = 1;
	}
}

message ScavengeResp {
	string scavenge_id = 1;
	ScavengeResult scavenge_result = 2;

	enum ScavengeResult {
		Started = 0;
		InProgress = 1;
		Stopped = 2;
	}
}

message SetNodePriorityReq {
	int32 priority = 1;
}