Merge branch '1.6' into 1.7

Conflicts:
        
server/master/src/main/java/org/apache/accumulo/master/tableOps/ImportTable.java
        
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/21059c58
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/21059c58
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/21059c58

Branch: refs/heads/master
Commit: 21059c58d2e7ecfc97c7557b5387776327b386b4
Parents: e0c72f2 18a3ef6
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Tue Jun 9 18:55:38 2015 -0400
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Tue Jun 9 18:55:38 2015 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/master/tableOps/CreateImportDir.java | 8 ++++----
 .../main/java/org/apache/accumulo/tserver/TabletServer.java  | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/21059c58/server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java
----------------------------------------------------------------------
diff --cc 
server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java
index cb70c68,0000000..0dfe2e1
mode 100644,000000..100644
--- 
a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java
+++ 
b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CreateImportDir.java
@@@ -1,65 -1,0 +1,65 @@@
 +/*
 + * 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.
 + */
 +package org.apache.accumulo.master.tableOps;
 +
++import java.io.IOException;
 +import java.util.Arrays;
 +
 +import org.apache.accumulo.core.Constants;
 +import org.apache.accumulo.fate.Repo;
 +import org.apache.accumulo.master.Master;
 +import org.apache.accumulo.server.ServerConstants;
 +import org.apache.accumulo.server.tablets.UniqueNameAllocator;
 +import org.apache.hadoop.fs.Path;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +class CreateImportDir extends MasterRepo {
 +  private static final Logger log = 
LoggerFactory.getLogger(CreateImportDir.class);
 +  private static final long serialVersionUID = 1L;
 +
 +  private ImportedTableInfo tableInfo;
 +
 +  CreateImportDir(ImportedTableInfo ti) {
 +    this.tableInfo = ti;
 +  }
 +
 +  @Override
 +  public Repo<Master> call(long tid, Master master) throws Exception {
 +
 +    UniqueNameAllocator namer = UniqueNameAllocator.getInstance();
 +
 +    Path exportDir = new Path(tableInfo.exportDir);
 +    String[] tableDirs = ServerConstants.getTablesDirs();
 +
 +    log.info("Looking for matching filesystem for " + exportDir + " from 
options " + Arrays.toString(tableDirs));
 +    Path base = master.getFileSystem().matchingFileSystem(exportDir, 
tableDirs);
-     log.info("Chose base table directory of " + base);
-     // Sanity check that a valid FileSystem was found for the exportDir
-     if (null == base) {
-       throw new RuntimeException("Could not determine matching FileSystem for 
" + exportDir);
++    if (base == null) {
++      throw new IOException(tableInfo.exportDir + " is not in a volume 
configured for Accumulo");
 +    }
++    log.info("Chose base table directory of " + base);
 +    Path directory = new Path(base, tableInfo.tableId);
 +
 +    Path newBulkDir = new Path(directory, Constants.BULK_PREFIX + 
namer.getNextName());
 +
 +    tableInfo.importDir = newBulkDir.toString();
 +
 +    log.info("Using import dir: " + tableInfo.importDir);
 +
 +    return new MapImportFileNames(tableInfo);
 +  }
 +}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/21059c58/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --cc 
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index b4c5e5f,0446da3..5656db4
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@@ -1711,8 -2536,12 +1711,12 @@@ public class TabletServer extends Accum
  
          try {
            Path source = new Path(filename);
 -          if (acuConf.getBoolean(Property.TSERV_ARCHIVE_WALOGS)) {
 +          if 
(TabletServer.this.getConfiguration().getBoolean(Property.TSERV_ARCHIVE_WALOGS))
 {
              Path walogArchive = fs.matchingFileSystem(source, 
ServerConstants.getWalogArchives());
+             if (walogArchive == null) {
+               throw new IOException(filename + " is not in a volume 
configured for Accumulo");
+             }
+ 
              fs.mkdirs(walogArchive);
              Path dest = new Path(walogArchive, source.getName());
              log.info("Archiving walog " + source + " to " + dest);

Reply via email to