Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 50869180630 for ; Tue, 2 Jan 2018 20:00:58 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 40765160C26; Tue, 2 Jan 2018 19:00:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 84CE9160C09 for ; Tue, 2 Jan 2018 20:00:57 +0100 (CET) Received: (qmail 87751 invoked by uid 500); 2 Jan 2018 19:00:56 -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 87742 invoked by uid 99); 2 Jan 2018 19:00:56 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jan 2018 19:00:56 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id F2A8681833; Tue, 2 Jan 2018 19:00:55 +0000 (UTC) Date: Tue, 02 Jan 2018 19:00:55 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo] branch 1.8 updated: ACCUMULO-4528 Add import/export table info to docs (#350) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <151491965592.19862.13661956317986609378@gitbox.apache.org> From: mwalch@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo X-Git-Refname: refs/heads/1.8 X-Git-Reftype: branch X-Git-Oldrev: 01b9bef94484615789f71325bfc7248dbbc72d0d X-Git-Newrev: 7fc61d438986232ef8c26c8260fd7e0610a1b22c X-Git-Rev: 7fc61d438986232ef8c26c8260fd7e0610a1b22c X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated archived-at: Tue, 02 Jan 2018 19:00:58 -0000 This is an automated email from the ASF dual-hosted git repository. mwalch pushed a commit to branch 1.8 in repository https://gitbox.apache.org/repos/asf/accumulo.git The following commit(s) were added to refs/heads/1.8 by this push: new 7fc61d4 ACCUMULO-4528 Add import/export table info to docs (#350) 7fc61d4 is described below commit 7fc61d438986232ef8c26c8260fd7e0610a1b22c Author: Mark Owens AuthorDate: Tue Jan 2 14:00:53 2018 -0500 ACCUMULO-4528 Add import/export table info to docs (#350) Updated 1.8 and 2.0 user manual documentation to include the import/export example within the documentation directly rather than requiring a user to click away from the manual pages to a different project (i.e., the accumulo-examples project) for that information. --- .../main/asciidoc/chapters/table_configuration.txt | 89 +++++++++++++++++++++- 1 file changed, 85 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/chapters/table_configuration.txt b/docs/src/main/asciidoc/chapters/table_configuration.txt index 5c62ccf..ca1eb88 100644 --- a/docs/src/main/asciidoc/chapters/table_configuration.txt +++ b/docs/src/main/asciidoc/chapters/table_configuration.txt @@ -637,7 +637,88 @@ root@a14 cic> Accumulo supports exporting tables for the purpose of copying tables to another cluster. Exporting and importing tables preserves the tables configuration, splits, and logical time. Tables are exported and then copied via the hadoop -distcp command. To export a table, it must be offline and stay offline while -discp runs. The reason it needs to stay offline is to prevent files from being -deleted. A table can be cloned and the clone taken offline inorder to avoid -losing access to the table. See +docs/examples/README.export+ for an example. +`distcp` command. To export a table, it must be offline and stay offline while +`distcp` runs. Staying offline prevents files from being deleted during the process. +An easy way to take a table offline without interrupting access is to clone it +and take the clone offline. + +==== Table Import/Export Example + +The following example demonstrates Accumulo's mechanism for exporting and +importing tables. + +The shell session below illustrates creating a table, inserting data, and +exporting the table. + + +---- + root@test15> createtable table1 + root@test15 table1> insert a cf1 cq1 v1 + root@test15 table1> insert h cf1 cq1 v2 + root@test15 table1> insert z cf1 cq1 v3 + root@test15 table1> insert z cf1 cq2 v4 + root@test15 table1> addsplits -t table1 b r + root@test15 table1> scan + a cf1:cq1 [] v1 + h cf1:cq1 [] v2 + z cf1:cq1 [] v3 + z cf1:cq2 [] v4 + root@test15> config -t table1 -s table.split.threshold=100M + root@test15 table1> clonetable table1 table1_exp + root@test15 table1> offline table1_exp + root@test15 table1> exporttable -t table1_exp /tmp/table1_export + root@test15 table1> quit +---- + +After executing the export command, a few files are created in the hdfs dir. +One of the files is a list of files to distcp as shown below. + +---- + $ hadoop fs -ls /tmp/table1_export + Found 2 items + -rw-r--r-- 3 user supergroup 162 2012-07-25 09:56 /tmp/table1_export/distcp.txt + -rw-r--r-- 3 user supergroup 821 2012-07-25 09:56 /tmp/table1_export/exportMetadata.zip + $ hadoop fs -cat /tmp/table1_export/distcp.txt + hdfs://n1.example.com:6093/accumulo/tables/3/default_tablet/F0000000.rf + hdfs://n1.example.com:6093/tmp/table1_export/exportMetadata.zip +---- + +Before the table can be imported, it must be copied using `distcp`. After the +`distcp` completea, the cloned table may be deleted. + +---- + $ hadoop distcp -f /tmp/table1_export/distcp.txt /tmp/table1_export_dest +---- + +The Accumulo shell session below shows importing the table and inspecting it. +The data, splits, config, and logical time information for the table were +preserved. + +---- + root@test15> importtable table1_copy /tmp/table1_export_dest + root@test15> table table1_copy + root@test15 table1_copy> scan + a cf1:cq1 [] v1 + h cf1:cq1 [] v2 + z cf1:cq1 [] v3 + z cf1:cq2 [] v4 + root@test15 table1_copy> getsplits -t table1_copy + b + r + root@test15> config -t table1_copy -f split + ---------+--------------------------+------------------------------------------- + SCOPE | NAME | VALUE + ---------+--------------------------+------------------------------------------- + default | table.split.threshold .. | 1G + table | @override ........... | 100M + ---------+--------------------------+------------------------------------------- + root@test15> tables -l + accumulo.metadata => !0 + accumulo.root => +r + table1_copy => 5 + trace => 1 + root@test15 table1_copy> scan -t accumulo.metadata -b 5 -c srv:time + 5;b srv:time [] M1343224500467 + 5;r srv:time [] M1343224500467 + 5< srv:time [] M1343224500467 +---- -- To stop receiving notification emails like this one, please contact ['"commits@accumulo.apache.org" '].