Package com.google.protobuf

Examples of com.google.protobuf.ServiceException


      Mockito.mock(ClientProtos.ClientService.BlockingInterface.class);
    HConnection connection = mockConnection(null, implementation);

    // If a 'get' is called on mocked interface, throw connection refused.
    Mockito.when(implementation.get((RpcController) Mockito.any(), (GetRequest) Mockito.any())).
      thenThrow(new ServiceException(ex));
    // Now start up the catalogtracker with our doctored Connection.
    final CatalogTracker ct = constructAndStartCatalogTracker(connection);

    MetaRegionTracker.setMetaLocation(this.watcher, SN);
    long timeout = UTIL.getConfiguration().
View Full Code Here


   */
  @Test
  public void testVerifyMetaRegionLocationFails()
  throws IOException, InterruptedException, KeeperException, ServiceException {
    HConnection connection = Mockito.mock(HConnection.class);
    ServiceException connectException =
      new ServiceException(new ConnectException("Connection refused"));
    final AdminProtos.AdminService.BlockingInterface implementation =
      Mockito.mock(AdminProtos.AdminService.BlockingInterface.class);
    Mockito.when(implementation.getRegionInfo((RpcController)Mockito.any(),
      (GetRegionInfoRequest)Mockito.any())).thenThrow(connectException);
    Mockito.when(connection.getAdmin(Mockito.any(ServerName.class), Mockito.anyBoolean())).
View Full Code Here

        LOG.info(String.format("tablespace \"%s\" (%s) is created", tablespaceName, uri));
        return ProtoUtil.TRUE;

      } catch (Exception e) {
        LOG.error(e);
        throw new ServiceException(e);
      } finally {
        wlock.unlock();
      }
    }
View Full Code Here

        store.dropTablespace(tablespaceName);
        return ProtoUtil.TRUE;

      } catch (Exception e) {
        LOG.error(e);
        throw new ServiceException(e);
      } finally {
        wlock.unlock();
      }
    }
View Full Code Here

        } else {
          return ProtoUtil.FALSE;
        }
      } catch (Exception e) {
        LOG.error(e);
        throw new ServiceException(e);
      } finally {
        rlock.unlock();
      }
    }
View Full Code Here

      rlock.lock();
      try {
        return ProtoUtil.convertStrings(store.getAllDatabaseNames());
      } catch (Exception e) {
        LOG.error(e);
        throw new ServiceException(e);
      } finally {
        rlock.unlock();
      }
    }
View Full Code Here

      rlock.lock();
      try {
        return store.getTablespace(request.getValue());
      } catch (Exception e) {
        LOG.error(e);
        throw new ServiceException(e);
      } finally {
        rlock.unlock();
      }
    }
View Full Code Here

            if (command.getType() == AlterTablespaceProto.AlterTablespaceType.LOCATION) {
              try {
                URI uri = URI.create(command.getLocation().getUri());
                Preconditions.checkArgument(uri.getScheme() != null);
              } catch (Exception e) {
                throw new ServiceException("ALTER TABLESPACE's LOCATION must be a URI form (scheme:///.../), but "
                    + command.getLocation().getUri());
              }
            }
          }
        }

        store.alterTablespace(request);
        return ProtoUtil.TRUE;
      } catch (Exception e) {
        LOG.error(e);
        throw new ServiceException(e);
      } finally {
        wlock.unlock();
      }
    }
View Full Code Here

        store.createDatabase(databaseName, tablespaceName);
        LOG.info(String.format("database \"%s\" is created", databaseName));
        return ProtoUtil.TRUE;
      } catch (Exception e) {
        LOG.error(e);
        throw new ServiceException(e);
      } finally {
        wlock.unlock();
      }
    }
View Full Code Here

        store.dropDatabase(databaseName);
        return ProtoUtil.TRUE;

      } catch (Exception e) {
        LOG.error(e);
        throw new ServiceException(e);
      } finally {
        wlock.unlock();
      }
    }
View Full Code Here

TOP

Related Classes of com.google.protobuf.ServiceException

Copyright © 2018 www.massapicom. 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.