Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E2231788F for ; Tue, 9 Jun 2015 23:07:38 +0000 (UTC) Received: (qmail 12286 invoked by uid 500); 9 Jun 2015 23:07:38 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 12245 invoked by uid 500); 9 Jun 2015 23:07:38 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 12211 invoked by uid 99); 9 Jun 2015 23:07:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2015 23:07:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2949BE0286; Tue, 9 Jun 2015 23:07:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Tue, 09 Jun 2015 23:07:41 -0000 Message-Id: <783ac087fc2348d9824f516b8e64aa2b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/6] accumulo git commit: Merge branch '1.6' into 1.7 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 Authored: Tue Jun 9 18:55:38 2015 -0400 Committer: Christopher Tubbs 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 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);