Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HTableInterface.coprocessorService()


                put.add(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES, PhoenixDatabaseMetaData.INDEX_STATE_BYTES, PIndexState.DISABLE.getSerializedBytes());
                put.add(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES, PhoenixDatabaseMetaData.INDEX_DISABLE_TIMESTAMP_BYTES, PDataType.LONG.toBytes(minTimeStamp));
                final List<Mutation> tableMetadata = Collections.<Mutation>singletonList(put);
               
                final Map<byte[], MetaDataResponse> results =
                        systemTable.coprocessorService(MetaDataService.class, indexTableKey, indexTableKey,
                            new Batch.Call<MetaDataService, MetaDataResponse>() {
                                @Override
                                public MetaDataResponse call(MetaDataService instance) throws IOException {
                                    ServerRpcController controller = new ServerRpcController();
                                    BlockingRpcCallback<MetaDataResponse> rpcCallback =
View Full Code Here


    }

    public static void clearMetaDataCache(Connection conn) throws Throwable {
        PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
        HTableInterface htable = pconn.getQueryServices().getTable(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME_BYTES);
        htable.coprocessorService(MetaDataService.class, HConstants.EMPTY_START_ROW,
            HConstants.EMPTY_END_ROW, new Batch.Call<MetaDataService, ClearCacheResponse>() {
                @Override
                public ClearCacheResponse call(MetaDataService instance) throws IOException {
                    ServerRpcController controller = new ServerRpcController();
                    BlockingRpcCallback<ClearCacheResponse> rpcCallback =
View Full Code Here

                }
            }

            HTableInterface ht = this.getTable(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME_BYTES);
            final Map<byte[], Long> results =
                    ht.coprocessorService(MetaDataService.class, null, null, new Batch.Call<MetaDataService,Long>() {
                        @Override
                        public Long call(MetaDataService instance) throws IOException {
                            ServerRpcController controller = new ServerRpcController();
                            BlockingRpcCallback<GetVersionResponse> rpcCallback =
                                    new BlockingRpcCallback<GetVersionResponse>();
View Full Code Here

                }

                HTableInterface ht = this.getTable(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME_BYTES);
                try {
                    final Map<byte[], MetaDataResponse> results =
                            ht.coprocessorService(MetaDataService.class, tableKey, tableKey, callable);

                    assert(results.size() == 1);
                    MetaDataResponse result = results.values().iterator().next();
                    if (result.getReturnCode() == MetaDataProtos.MutationCode.TABLE_NOT_IN_REGION) {
                        if (retried) return MetaDataMutationResult.constructFromProto(result);
View Full Code Here

    protected void clearCache() throws SQLException {
        try {
            SQLException sqlE = null;
            HTableInterface htable = this.getTable(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME_BYTES);
            try {
                htable.coprocessorService(MetaDataService.class, HConstants.EMPTY_START_ROW,
                        HConstants.EMPTY_END_ROW, new Batch.Call<MetaDataService, ClearCacheResponse>() {
                    @Override
                    public ClearCacheResponse call(MetaDataService instance) throws IOException {
                        ServerRpcController controller = new ServerRpcController();
                        BlockingRpcCallback<ClearCacheResponse> rpcCallback =
View Full Code Here

                       
                        @Override
                        public Boolean call() throws Exception {
                            final Map<byte[], AddServerCacheResponse> results;
                            try {
                                results = htable.coprocessorService(ServerCachingService.class, key, key,
                                            new Batch.Call<ServerCachingService, AddServerCacheResponse>() {
                                                @Override
                                                public AddServerCacheResponse call(ServerCachingService instance) throws IOException {
                                                    ServerRpcController controller = new ServerRpcController();
                                                    BlockingRpcCallback<AddServerCacheResponse> rpcCallback =
View Full Code Here

        if (LOG.isDebugEnabled()) {LOG.debug("Removing Cache " + cacheId + " from servers.");}
        for (HRegionLocation entry : locations) {
          if (remainingOnServers.contains(entry)) {  // Call once per server
            try {
              byte[] key = entry.getRegionInfo().getStartKey();
              iterateOverTable.coprocessorService(ServerCachingService.class, key, key,
                  new Batch.Call<ServerCachingService, RemoveServerCacheResponse>() {
                @Override
                public RemoveServerCacheResponse call(ServerCachingService instance) throws IOException {
                  ServerRpcController controller = new ServerRpcController();
                  BlockingRpcCallback<RemoveServerCacheResponse> rpcCallback =
View Full Code Here

    }

    public static void clearMetaDataCache(Connection conn) throws Throwable {
        PhoenixConnection pconn = conn.unwrap(PhoenixConnection.class);
        HTableInterface htable = pconn.getQueryServices().getTable(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME_BYTES);
        htable.coprocessorService(MetaDataService.class, HConstants.EMPTY_START_ROW,
            HConstants.EMPTY_END_ROW, new Batch.Call<MetaDataService, ClearCacheResponse>() {
                @Override
                public ClearCacheResponse call(MetaDataService instance) throws IOException {
                    ServerRpcController controller = new ServerRpcController();
                    BlockingRpcCallback<ClearCacheResponse> rpcCallback =
View Full Code Here

                       
                        @Override
                        public Boolean call() throws Exception {
                            final Map<byte[], AddServerCacheResponse> results;
                            try {
                                results = htable.coprocessorService(ServerCachingService.class, key, key,
                                            new Batch.Call<ServerCachingService, AddServerCacheResponse>() {
                                                @Override
                                                public AddServerCacheResponse call(ServerCachingService instance) throws IOException {
                                                    ServerRpcController controller = new ServerRpcController();
                                                    BlockingRpcCallback<AddServerCacheResponse> rpcCallback =
View Full Code Here

        if (LOG.isDebugEnabled()) {LOG.debug("Removing Cache " + cacheId + " from servers.");}
        for (HRegionLocation entry : locations) {
            if (remainingOnServers.contains(entry)) {  // Call once per server
                try {
                    byte[] key = entry.getRegionInfo().getStartKey();
                    iterateOverTable.coprocessorService(ServerCachingService.class, key, key,
                        new Batch.Call<ServerCachingService, RemoveServerCacheResponse>() {
                            @Override
                            public RemoveServerCacheResponse call(ServerCachingService instance) throws IOException {
                                ServerRpcController controller = new ServerRpcController();
                                BlockingRpcCallback<RemoveServerCacheResponse> rpcCallback =
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.