Package org.apache.accumulo.server.fs

Examples of org.apache.accumulo.server.fs.VolumeManager


    return new PopulateMetadata(tableInfo);
  }

  @Override
  public void undo(long tid, Master master) throws Exception {
    VolumeManager fs = master.getFileSystem();
    fs.deleteRecursively(new Path(tableInfo.dir));

  }
View Full Code Here


    Set<Path> processing = new HashSet<Path>();
    ExecutorService threadPool = Executors.newFixedThreadPool(16);

    System.out.printf("Scanning : %s %s\n", table, range);

    VolumeManager fs = VolumeManagerImpl.get();
    Connector connector = instance.getConnector(principal, token);
    Scanner metadata = connector.createScanner(table, Authorizations.EMPTY);
    metadata.setRange(range);
    metadata.fetchColumnFamily(DataFileColumnFamily.NAME);
    int count = 0;
    AtomicInteger missing = new AtomicInteger(0);
    AtomicReference<Exception> exceptionRef = new AtomicReference<Exception>(null);
    BatchWriter writer = null;

    if (fix)
      writer = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());

    for (Entry<Key,Value> entry : metadata) {
      if (exceptionRef.get() != null)
        break;

      count++;
      Key key = entry.getKey();
      Path map = fs.getFullPath(key);

      synchronized (processing) {
        while (processing.size() >= 64 || processing.contains(map))
          processing.wait();
View Full Code Here

    List<String> argsList = new ArrayList<String>(args.length + 2);
    argsList.add("--old");
    argsList.add("--new");
    argsList.addAll(Arrays.asList(args));
    opts.parseArgs(ChangeSecret.class.getName(), argsList.toArray(new String[0]));
    VolumeManager fs = VolumeManagerImpl.get();
    Instance inst = opts.getInstance();
    if (!verifyAccumuloIsDown(inst, opts.oldPass))
      System.exit(-1);
    String instanceId = rewriteZooKeeperInstance(inst, opts.oldPass, opts.newPass);
    updateHdfs(fs, inst, instanceId);
View Full Code Here

  private static synchronized void _getInstanceID() {
    if (instanceId == null) {
      AccumuloConfiguration acuConf = ServerConfiguration.getSiteConfiguration();
      // InstanceID should be the same across all volumes, so just choose one
      VolumeManager fs;
      try {
        fs = VolumeManagerImpl.get();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
View Full Code Here

    ConfigurationCopy conf = new ConfigurationCopy();
    conf.set(Property.INSTANCE_DFS_URI, "file:///");
    conf.set(Property.INSTANCE_DFS_DIR, "/");

    VolumeManager vm = VolumeManagerImpl.get(conf);

    TestWrapper wrapper = new TestWrapper(vm, conf, "A00004.rf", "A00002.rf", "F00003.rf");
    wrapper.prepareReplacement();
    wrapper.renameReplacement();
    wrapper.finishReplacement();
View Full Code Here

  private static List<Mutation> recover(Map<String,KeyValue[]> logs, Set<String> files, KeyExtent extent) throws IOException {
    TemporaryFolder root = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
    root.create();
    final String workdir = root.getRoot().getAbsolutePath() + "/workdir";
    VolumeManager fs = VolumeManagerImpl.getLocal(workdir);
    final Path workdirPath = new Path("file://" + workdir);
    fs.deleteRecursively(workdirPath);
    ArrayList<Path> dirs = new ArrayList<Path>();
    try {
      for (Entry<String,KeyValue[]> entry : logs.entrySet()) {
        String path = workdir + "/" + entry.getKey();
        FileSystem ns = fs.getVolumeByPath(new Path(path)).getFileSystem();
        @SuppressWarnings("deprecation")
        Writer map = new MapFile.Writer(ns.getConf(), ns, path + "/log1", LogFileKey.class, LogFileValue.class);
        for (KeyValue lfe : entry.getValue()) {
          map.append(lfe.key, lfe.value);
        }
View Full Code Here

    }
   
    if (refCount == 0) {
      // delete the map files
      try {
        VolumeManager fs = master.getFileSystem();
        for (String dir : ServerConstants.getTablesDirs()) {
          fs.deleteRecursively(new Path(dir, tableId));
        }
      } catch (IOException e) {
        log.error("Unable to remove deleted table directory", e);
      } catch (IllegalArgumentException exception) {
        if (exception.getCause() instanceof UnknownHostException) {
View Full Code Here

        return "0 0 0 0";
     
    }
   
    private String getFSStats() throws Exception {
      VolumeManager fs = VolumeManagerImpl.get();
      long length1 = 0, dcount1 = 0, fcount1 = 0;
      long length2 = 0, dcount2 = 0, fcount2 = 0;
      for (String dir : ServerConstants.getTablesDirs()) {
        ContentSummary contentSummary = fs.getContentSummary(new Path(dir));
        length1 += contentSummary.getLength();
        dcount1 += contentSummary.getDirectoryCount();
        fcount1 += contentSummary.getFileCount();
        contentSummary = fs.getContentSummary(new Path(dir, tableId));
        length2 += contentSummary.getLength();
        dcount2 += contentSummary.getDirectoryCount();
        fcount2 += contentSummary.getFileCount();
      }
     
View Full Code Here

  public static void main(String[] args) throws Exception {
    try {
      SecurityUtil.serverLogin(ServerConfiguration.getSiteConfiguration());

      VolumeManager fs = VolumeManagerImpl.get();
      ServerOpts opts = new ServerOpts();
      opts.parseArgs("master", args);
      String hostname = opts.getAddress();
      Instance instance = HdfsZooInstance.getInstance();
      ServerConfiguration conf = new ServerConfiguration(instance);
View Full Code Here

  }

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

TOP

Related Classes of org.apache.accumulo.server.fs.VolumeManager

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.