/** * 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. */ // This file contains protocol buffers that are used for MasterAdminProtocol. import "Master.proto"; option java_package = "org.apache.hadoop.hbase.protobuf.generated"; option java_outer_classname = "MasterAdminProtos"; option java_generic_services = true; option java_generate_equals_and_hash = true; option optimize_for = SPEED; import "hbase.proto"; import "Client.proto"; /* Column-level protobufs */ message AddColumnRequest { required bytes tableName = 1; required ColumnFamilySchema columnFamilies = 2; } message AddColumnResponse { } message DeleteColumnRequest { required bytes tableName = 1; required bytes columnName = 2; } message DeleteColumnResponse { } message ModifyColumnRequest { required bytes tableName = 1; required ColumnFamilySchema columnFamilies = 2; } message ModifyColumnResponse { } /* Region-level Protos */ message MoveRegionRequest { required RegionSpecifier region = 1; optional ServerName destServerName = 2; } message MoveRegionResponse { } /** * Dispatch merging the specified regions. */ message DispatchMergingRegionsRequest { required RegionSpecifier regionA = 1; required RegionSpecifier regionB = 2; optional bool forcible = 3 [default = false]; } message DispatchMergingRegionsResponse { } message AssignRegionRequest { required RegionSpecifier region = 1; } message AssignRegionResponse { } message UnassignRegionRequest { required RegionSpecifier region = 1; optional bool force = 2 [default = false]; } message UnassignRegionResponse { } message OfflineRegionRequest { required RegionSpecifier region = 1; } message OfflineRegionResponse { } /* Table-level protobufs */ message CreateTableRequest { required TableSchema tableSchema = 1; repeated bytes splitKeys = 2; } message CreateTableResponse { } message DeleteTableRequest { required bytes tableName = 1; } message DeleteTableResponse { } message EnableTableRequest { required bytes tableName = 1; } message EnableTableResponse { } message DisableTableRequest { required bytes tableName = 1; } message DisableTableResponse { } message ModifyTableRequest { required bytes tableName = 1; required TableSchema tableSchema = 2; } message ModifyTableResponse { } /* Cluster-level protobufs */ message ShutdownRequest { } message ShutdownResponse { } message StopMasterRequest { } message StopMasterResponse { } message BalanceRequest { } message BalanceResponse { required bool balancerRan = 1; } message SetBalancerRunningRequest { required bool on = 1; optional bool synchronous = 2; } message SetBalancerRunningResponse { optional bool prevBalanceValue = 1; } message CatalogScanRequest { } message CatalogScanResponse { optional int32 scanResult = 1; } message EnableCatalogJanitorRequest { required bool enable = 1; } message EnableCatalogJanitorResponse { optional bool prevValue = 1; } message IsCatalogJanitorEnabledRequest { } message IsCatalogJanitorEnabledResponse { required bool value = 1; } message TakeSnapshotRequest{ required SnapshotDescription snapshot = 1; } message TakeSnapshotResponse{ required int64 expectedTimeout = 1; } message ListSnapshotRequest{ } message ListSnapshotResponse{ repeated SnapshotDescription snapshots = 1; } message DeleteSnapshotRequest{ required SnapshotDescription snapshot = 1; } message DeleteSnapshotResponse{ } message RestoreSnapshotRequest { required SnapshotDescription snapshot = 1; } message RestoreSnapshotResponse { } /* if you don't send the snapshot, then you will get it back * in the response (if the snapshot is done) so you can check the snapshot */ message IsSnapshotDoneRequest{ optional SnapshotDescription snapshot = 1; } message IsSnapshotDoneResponse{ optional bool done = 1 [default = false]; optional SnapshotDescription snapshot = 2; } message IsRestoreSnapshotDoneRequest { optional SnapshotDescription snapshot = 1; } message IsRestoreSnapshotDoneResponse { optional bool done = 1 [default = true]; } service MasterAdminService { /** Adds a column to the specified table. */ rpc addColumn(AddColumnRequest) returns(AddColumnResponse); /** Deletes a column from the specified table. Table must be disabled. */ rpc deleteColumn(DeleteColumnRequest) returns(DeleteColumnResponse); /** Modifies an existing column on the specified table. */ rpc modifyColumn(ModifyColumnRequest) returns(ModifyColumnResponse); /** Move the region region to the destination server. */ rpc moveRegion(MoveRegionRequest) returns(MoveRegionResponse); /** Master dispatch merging the regions */ rpc dispatchMergingRegions(DispatchMergingRegionsRequest) returns(DispatchMergingRegionsResponse); /** Assign a region to a server chosen at random. */ rpc assignRegion(AssignRegionRequest) returns(AssignRegionResponse); /** * Unassign a region from current hosting regionserver. Region will then be * assigned to a regionserver chosen at random. Region could be reassigned * back to the same server. Use moveRegion if you want * to control the region movement. */ rpc unassignRegion(UnassignRegionRequest) returns(UnassignRegionResponse); /** * Offline a region from the assignment manager's in-memory state. The * region should be in a closed state and there will be no attempt to * automatically reassign the region as in unassign. This is a special * method, and should only be used by experts or hbck. */ rpc offlineRegion(OfflineRegionRequest) returns(OfflineRegionResponse); /** Deletes a table */ rpc deleteTable(DeleteTableRequest) returns(DeleteTableResponse); /** Puts the table on-line (only needed if table has been previously taken offline) */ rpc enableTable(EnableTableRequest) returns(EnableTableResponse); /** Take table offline */ rpc disableTable(DisableTableRequest) returns(DisableTableResponse); /** Modify a table's metadata */ rpc modifyTable(ModifyTableRequest) returns(ModifyTableResponse); /** Creates a new table asynchronously */ rpc createTable(CreateTableRequest) returns(CreateTableResponse); /** Shutdown an HBase cluster. */ rpc shutdown(ShutdownRequest) returns(ShutdownResponse); /** Stop HBase Master only. Does not shutdown the cluster. */ rpc stopMaster(StopMasterRequest) returns(StopMasterResponse); /** * Run the balancer. Will run the balancer and if regions to move, it will * go ahead and do the reassignments. Can NOT run for various reasons. * Check logs. */ rpc balance(BalanceRequest) returns(BalanceResponse); /** * Turn the load balancer on or off. * If synchronous is true, it waits until current balance() call, if outstanding, to return. */ rpc setBalancerRunning(SetBalancerRunningRequest) returns(SetBalancerRunningResponse); /** Get a run of the catalog janitor */ rpc runCatalogScan(CatalogScanRequest) returns(CatalogScanResponse); /** * Enable the catalog janitor on or off. */ rpc enableCatalogJanitor(EnableCatalogJanitorRequest) returns(EnableCatalogJanitorResponse); /** * Query whether the catalog janitor is enabled. */ rpc isCatalogJanitorEnabled(IsCatalogJanitorEnabledRequest) returns(IsCatalogJanitorEnabledResponse); /** * Call a master coprocessor endpoint */ rpc execMasterService(CoprocessorServiceRequest) returns(CoprocessorServiceResponse); /** * Create a snapshot for the given table. * @param snapshot description of the snapshot to take */ rpc snapshot(TakeSnapshotRequest) returns(TakeSnapshotResponse); /** * List completed snapshots. * Returns a list of snapshot descriptors for completed snapshots */ rpc getCompletedSnapshots(ListSnapshotRequest) returns(ListSnapshotResponse); /** * Delete an existing snapshot. This method can also be used to clean up an aborted snapshot. * @param snapshotName snapshot to delete */ rpc deleteSnapshot(DeleteSnapshotRequest) returns(DeleteSnapshotResponse); /** * Determine if the snapshot is done yet. */ rpc isSnapshotDone(IsSnapshotDoneRequest) returns(IsSnapshotDoneResponse); /** * Restore a snapshot * @param snapshot description of the snapshot to restore */ rpc restoreSnapshot(RestoreSnapshotRequest) returns(RestoreSnapshotResponse); /** * Determine if the snapshot restore is done yet. */ rpc isRestoreSnapshotDone(IsRestoreSnapshotDoneRequest) returns(IsRestoreSnapshotDoneResponse); /** return true if master is available */ rpc isMasterRunning(IsMasterRunningRequest) returns(IsMasterRunningResponse); }