Package org.apache.accumulo.server.conf

Examples of org.apache.accumulo.server.conf.ServerConfiguration


    ClassLoader loader = getClass().getClassLoader();
    Class<?> shouldMatch;
    try {
      shouldMatch = loader.loadClass(interfaceMatch);

      new ServerConfiguration(instance).getNamespaceConfiguration(namespaceId);

      String context = new ServerConfiguration(instance).getNamespaceConfiguration(namespaceId).get(Property.TABLE_CLASSPATH);

      ClassLoader currentLoader;

      if (context != null && !context.equals("")) {
        currentLoader = AccumuloVFSClassLoader.getContextManager().getClassLoader(context);
View Full Code Here


        if (!security.canScan(credentials, tableId, namespaceId))
          throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
      }

      // use the same set of tableIds that were validated above to avoid race conditions
      Map<TreeSet<String>,Long> diskUsage = TableDiskUsage.getDiskUsage(new ServerConfiguration(instance).getConfiguration(), tableIds, fs, conn);
      List<TDiskUsage> retUsages = new ArrayList<TDiskUsage>();
      for (Map.Entry<TreeSet<String>,Long> usageItem : diskUsage.entrySet()) {
        retUsages.add(new TDiskUsage(new ArrayList<String>(usageItem.getKey()), usageItem.getValue()));
      }
      return retUsages;
View Full Code Here

 
  public static void main(String[] args) {
    Opts opts = new Opts();
    opts.parseArgs(WrongTabletTest.class.getName(), args);
   
    ServerConfiguration conf = new ServerConfiguration(opts.getInstance());
    try {
      TabletClientService.Iface client = ThriftUtil.getTServerClient(opts.location, conf.getConfiguration());
     
      Mutation mutation = new Mutation(new Text("row_0003750001"));
      mutation.putDelete(new Text("colf"), new Text("colq"));
      client.update(Tracer.traceInfo(), new Credentials(opts.principal, opts.getToken()).toThrift(opts.getInstance()), new KeyExtent(new Text("!!"), null,
          new Text("row_0003750000")).toThrift(), mutation.toThrift());
View Full Code Here

  public static void main(String[] args) throws Exception {
    SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
    ServerOpts opts = new ServerOpts();
    opts.parseArgs("tracer", args);
    Instance instance = HdfsZooInstance.getInstance();
    ServerConfiguration conf = new ServerConfiguration(instance);
    VolumeManager fs = VolumeManagerImpl.get();
    Accumulo.init(fs, conf, "tracer");
    String hostname = opts.getAddress();
    TraceServer server = new TraceServer(conf, hostname);
    Accumulo.enableTracing(hostname, "tserver");
View Full Code Here

  private Instance instance;

  public static void main(String[] args) throws UnknownHostException, IOException {
    SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());
    Instance instance = HdfsZooInstance.getInstance();
    ServerConfiguration serverConf = new ServerConfiguration(instance);
    final VolumeManager fs = VolumeManagerImpl.get();
    Accumulo.init(fs, serverConf, "gc");
    Opts opts = new Opts();
    opts.parseArgs("gc", args);
    SimpleGarbageCollector gc = new SimpleGarbageCollector(opts);

    gc.init(fs, instance, SystemCredentials.get(), serverConf.getConfiguration().getBoolean(Property.GC_TRASH_IGNORE));
    Accumulo.enableTracing(opts.getAddress(), "gc");
    gc.run();
  }
View Full Code Here

    ServerOpts opts = new ServerOpts();
    opts.parseArgs("monitor", args);
    String hostname = opts.getAddress();

    instance = HdfsZooInstance.getInstance();
    config = new ServerConfiguration(instance);
    Accumulo.init(fs, config, "monitor");
    Monitor monitor = new Monitor();
    Accumulo.enableTracing(hostname, "monitor");
    monitor.run(hostname);
  }
View Full Code Here

    final String columns[] = columnsTmp;
   
    final VolumeManager fs = VolumeManagerImpl.get();
   
    Instance instance = opts.getInstance();
    final ServerConfiguration sconf = new ServerConfiguration(instance);
   
    String tableId = Tables.getNameToIdMap(instance).get(opts.tableName);
    if (tableId == null) {
      log.error("Unable to find table named " + opts.tableName);
      System.exit(-1);
    }
   
    TreeMap<KeyExtent,String> tabletLocations = new TreeMap<KeyExtent,String>();
    List<KeyExtent> candidates = findTablets(!opts.selectFarTablets, new Credentials(opts.principal, opts.getToken()), opts.tableName, instance,
        tabletLocations);
   
    if (candidates.size() < opts.numThreads) {
      System.err.println("ERROR : Unable to find " + opts.numThreads + " " + (opts.selectFarTablets ? "far" : "local") + " tablets");
      System.exit(-1);
    }
   
    List<KeyExtent> tabletsToTest = selectRandomTablets(opts.numThreads, candidates);
   
    Map<KeyExtent,List<FileRef>> tabletFiles = new HashMap<KeyExtent,List<FileRef>>();
   
    for (KeyExtent ke : tabletsToTest) {
      List<FileRef> files = getTabletFiles(new Credentials(opts.principal, opts.getToken()), opts.getInstance(), tableId, ke);
      tabletFiles.put(ke, files);
    }
   
    System.out.println();
    System.out.println("run location      : " + InetAddress.getLocalHost().getHostName() + "/" + InetAddress.getLocalHost().getHostAddress());
    System.out.println("num threads       : " + opts.numThreads);
    System.out.println("table             : " + opts.tableName);
    System.out.println("table id          : " + tableId);
   
    for (KeyExtent ke : tabletsToTest) {
      System.out.println("\t *** Information about tablet " + ke.getUUID() + " *** ");
      System.out.println("\t\t# files in tablet : " + tabletFiles.get(ke).size());
      System.out.println("\t\ttablet location   : " + tabletLocations.get(ke));
      reportHdfsBlockLocations(tabletFiles.get(ke));
    }
   
    System.out.println("%n*** RUNNING TEST ***%n");
   
    ExecutorService threadPool = Executors.newFixedThreadPool(opts.numThreads);
   
    for (int i = 0; i < opts.iterations; i++) {
     
      ArrayList<Test> tests = new ArrayList<Test>();
     
      for (final KeyExtent ke : tabletsToTest) {
        final List<FileRef> files = tabletFiles.get(ke);
        Test test = new Test(ke) {
          @Override
          public int runTest() throws Exception {
            return readFiles(fs, sconf.getConfiguration(), files, ke, columns);
          }
         
        };
       
        tests.add(test);
View Full Code Here

          extentList.add(keyExtent);
      }
    }
   
    ExecutorService tp = Executors.newFixedThreadPool(20);
    final ServerConfiguration conf = new ServerConfiguration(inst);
    for (final Entry<String,List<KeyExtent>> entry : extentsPerServer.entrySet()) {
      Runnable r = new Runnable() {
       
        @Override
        public void run() {
          try {
            checkTabletServer(inst, conf.getConfiguration(), new Credentials(opts.principal, opts.getToken()), entry, failures);
          } catch (Exception e) {
            System.err.println("Failure on ts " + entry.getKey() + " " + e.getMessage());
            e.printStackTrace();
            failures.addAll(entry.getValue());
          }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.server.conf.ServerConfiguration

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.