blob: e61db1197e46aeb870503219bd35361fe3b0bfff [file] [log] [blame]
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
syntax = "proto2";
package kudu.tserver;
option java_package = "org.apache.kudu.tserver";
import "kudu/common/common.proto";
import "kudu/consensus/metadata.proto";
import "kudu/rpc/rpc_header.proto";
import "kudu/tablet/metadata.proto";
import "kudu/tserver/tserver.proto";
message AlterSchemaRequestPB {
// UUID of server this request is addressed to.
optional bytes dest_uuid = 5;
required bytes tablet_id = 1;
// TODO: Replace with the table descriptor
// (Schema, Column IDs, Column Attributes)
required SchemaPB schema = 2;
required uint32 schema_version = 3;
optional string new_table_name = 4;
optional TableExtraConfigPB new_extra_config = 6;
}
message AlterSchemaResponsePB {
optional TabletServerErrorPB error = 1;
// The timestamp chosen by the server for this alter schema operation.
// TODO KUDU-611 propagate timestamps with server signature.
optional fixed64 timestamp = 2;
}
// A create tablet request.
message CreateTabletRequestPB {
// UUID of server this request is addressed to.
optional bytes dest_uuid = 8;
required bytes table_id = 1;
required bytes tablet_id = 2;
// DEPRECATED.
optional bytes start_key = 3;
// DEPRECATED.
optional bytes end_key = 4;
// The partition of the tablet.
optional PartitionPB partition = 9;
required string table_name = 5;
required SchemaPB schema = 6;
// The partition schema of the table which the tablet belongs to.
optional PartitionSchemaPB partition_schema = 10;
// Initial consensus configuration for the tablet.
required consensus.RaftConfigPB config = 7;
// The table's extra-config.
optional TableExtraConfigPB extra_config = 11;
// The dimension label for tablet. Used by the master to determine load when
// creating new tablet replicas based on dimension.
optional string dimension_label = 12;
}
message CreateTabletResponsePB {
optional TabletServerErrorPB error = 1;
}
// A delete tablet request.
message DeleteTabletRequestPB {
// UUID of server this request is addressed to.
optional bytes dest_uuid = 4;
required bytes tablet_id = 1;
// Reason the tablet is being deleted (for logging purposes)
optional string reason = 2;
// Must be one of TABLET_DATA_DELETED (for table deletes) or
// TABLET_DATA_TOMBSTONED (for replica retirement).
optional tablet.TabletDataState delete_type = 3 [ default = TABLET_DATA_TOMBSTONED ];
// The highest allowed OpId index of the latest known committed config.
// This optional parameter is here to provide an atomic (compare-and-swap)
// DeleteTablet operation. If this parameter is specified, the DeleteTablet()
// operation will succeed only if the committed config has an opid_index that
// is less than or equal to this value.
// See also the definition of RaftConfigPB.
// Note: At the time of this writing, there is a small race between checking
// the value of the committed config opid index and shutting down the tablet
// for deletion. See comments in ts_tablet_manager.cc
optional int64 cas_config_opid_index_less_or_equal = 5;
}
message DeleteTabletResponsePB {
optional TabletServerErrorPB error = 1;
}
// Enum of the server's Tablet Manager state: currently this is only
// used for assertions, but this can also be sent to the master.
enum TSTabletManagerStatePB {
UNKNOWN = 999;
// Indicates that Tablet Manager is initializing.
MANAGER_INITIALIZING = 0;
// Indicates that Tablet Manager is running and can create new
// tablets.
MANAGER_RUNNING = 1;
// Indicates that tablet manager is shutting down and no new tablets
// can be created.
MANAGER_QUIESCING = 2;
// Tablet Manager has shutdown.
MANAGER_SHUTDOWN = 3;
}
service TabletServerAdminService {
option (kudu.rpc.default_authz_method) = "AuthorizeServiceUser";
// Create a new, empty tablet with the specified parameters. Only used for
// brand-new tablets, not for "moves".
rpc CreateTablet(CreateTabletRequestPB) returns (CreateTabletResponsePB);
// Delete a tablet replica.
rpc DeleteTablet(DeleteTabletRequestPB) returns (DeleteTabletResponsePB);
// Alter a tablet's schema.
rpc AlterSchema(AlterSchemaRequestPB) returns (AlterSchemaResponsePB);
// Quiesce the tablet server.
rpc Quiesce(QuiesceTabletServerRequestPB) returns (QuiesceTabletServerResponsePB);
}
message QuiesceTabletServerRequestPB {
// Indicates whether the request is to start quiescing or to stop quiescing.
// If not set, the tserver's quiescing state will not be changed.
optional bool quiesce = 1;
// Indicates whether to return the number of tablet leaders and active
// scanners.
optional bool return_stats = 2;
}
message QuiesceTabletServerResponsePB {
// The error, if an error occurred with this request.
optional TabletServerErrorPB error = 1;
// The number of active scanners on the given tablet server. Only returned if
// stats were requested.
optional int32 num_active_scanners = 2;
// The number of tablet leaders hosted on the given tablet server. Only
// returned if stats were requested.
optional int32 num_leaders = 3;
}