[09/50] [abbrv] hadoop git commit: HADOOP-14154 Persist isAuthoritative bit in DynamoDBMetaStore (Contributed by Gabor Bota)

2018-08-25 Thread shv
HADOOP-14154 Persist isAuthoritative bit in DynamoDBMetaStore (Contributed by 
Gabor Bota)


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

Branch: refs/heads/HDFS-12943
Commit: d7232857d8d1e10cdac171acdc931187e45fd6be
Parents: 8d7c931
Author: Aaron Fabbri 
Authored: Fri Aug 17 10:08:30 2018 -0700
Committer: Aaron Fabbri 
Committed: Fri Aug 17 10:15:39 2018 -0700

--
 .../hadoop/fs/s3a/s3guard/DDBPathMetadata.java  |  77 +++
 .../fs/s3a/s3guard/DynamoDBMetadataStore.java   | 130 +++
 .../PathMetadataDynamoDBTranslation.java|  71 --
 .../apache/hadoop/fs/s3a/s3guard/S3Guard.java   |   4 +
 .../site/markdown/tools/hadoop-aws/s3guard.md   |   5 +-
 .../fs/s3a/s3guard/MetadataStoreTestBase.java   |  49 +++
 .../TestPathMetadataDynamoDBTranslation.java|  47 ++-
 7 files changed, 337 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7232857/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DDBPathMetadata.java
--
diff --git 
a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DDBPathMetadata.java
 
b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DDBPathMetadata.java
new file mode 100644
index 000..a67fc4e
--- /dev/null
+++ 
b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DDBPathMetadata.java
@@ -0,0 +1,77 @@
+/*
+ * 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.hadoop.fs.s3a.s3guard;
+
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.s3a.Tristate;
+
+/**
+ * {@code DDBPathMetadata} wraps {@link PathMetadata} and adds the
+ * isAuthoritativeDir flag to provide support for authoritative directory
+ * listings in {@link DynamoDBMetadataStore}.
+ */
+public class DDBPathMetadata extends PathMetadata {
+
+  private boolean isAuthoritativeDir;
+
+  public DDBPathMetadata(PathMetadata pmd, boolean isAuthoritativeDir) {
+super(pmd.getFileStatus(), pmd.isEmptyDirectory(), pmd.isDeleted());
+this.isAuthoritativeDir = isAuthoritativeDir;
+  }
+
+  public DDBPathMetadata(PathMetadata pmd) {
+super(pmd.getFileStatus(), pmd.isEmptyDirectory(), pmd.isDeleted());
+this.isAuthoritativeDir = false;
+  }
+
+  public DDBPathMetadata(FileStatus fileStatus) {
+super(fileStatus);
+this.isAuthoritativeDir = false;
+  }
+
+  public DDBPathMetadata(FileStatus fileStatus, Tristate isEmptyDir,
+  boolean isDeleted) {
+super(fileStatus, isEmptyDir, isDeleted);
+this.isAuthoritativeDir = false;
+  }
+
+  public DDBPathMetadata(FileStatus fileStatus, Tristate isEmptyDir,
+  boolean isDeleted, boolean isAuthoritativeDir) {
+super(fileStatus, isEmptyDir, isDeleted);
+this.isAuthoritativeDir = isAuthoritativeDir;
+  }
+
+  public boolean isAuthoritativeDir() {
+return isAuthoritativeDir;
+  }
+
+  public void setAuthoritativeDir(boolean authoritativeDir) {
+isAuthoritativeDir = authoritativeDir;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+return super.equals(o);
+  }
+
+  @Override public int hashCode() {
+return super.hashCode();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7232857/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
--
diff --git 
a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
 
b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
index ba80b88..ddb493f 100644
--- 
a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
+++ 

hadoop git commit: HADOOP-14154 Persist isAuthoritative bit in DynamoDBMetaStore (Contributed by Gabor Bota)

2018-08-17 Thread fabbri
Repository: hadoop
Updated Branches:
  refs/heads/trunk 8d7c93186 -> d7232857d


HADOOP-14154 Persist isAuthoritative bit in DynamoDBMetaStore (Contributed by 
Gabor Bota)


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

Branch: refs/heads/trunk
Commit: d7232857d8d1e10cdac171acdc931187e45fd6be
Parents: 8d7c931
Author: Aaron Fabbri 
Authored: Fri Aug 17 10:08:30 2018 -0700
Committer: Aaron Fabbri 
Committed: Fri Aug 17 10:15:39 2018 -0700

--
 .../hadoop/fs/s3a/s3guard/DDBPathMetadata.java  |  77 +++
 .../fs/s3a/s3guard/DynamoDBMetadataStore.java   | 130 +++
 .../PathMetadataDynamoDBTranslation.java|  71 --
 .../apache/hadoop/fs/s3a/s3guard/S3Guard.java   |   4 +
 .../site/markdown/tools/hadoop-aws/s3guard.md   |   5 +-
 .../fs/s3a/s3guard/MetadataStoreTestBase.java   |  49 +++
 .../TestPathMetadataDynamoDBTranslation.java|  47 ++-
 7 files changed, 337 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7232857/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DDBPathMetadata.java
--
diff --git 
a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DDBPathMetadata.java
 
b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DDBPathMetadata.java
new file mode 100644
index 000..a67fc4e
--- /dev/null
+++ 
b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DDBPathMetadata.java
@@ -0,0 +1,77 @@
+/*
+ * 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.hadoop.fs.s3a.s3guard;
+
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.s3a.Tristate;
+
+/**
+ * {@code DDBPathMetadata} wraps {@link PathMetadata} and adds the
+ * isAuthoritativeDir flag to provide support for authoritative directory
+ * listings in {@link DynamoDBMetadataStore}.
+ */
+public class DDBPathMetadata extends PathMetadata {
+
+  private boolean isAuthoritativeDir;
+
+  public DDBPathMetadata(PathMetadata pmd, boolean isAuthoritativeDir) {
+super(pmd.getFileStatus(), pmd.isEmptyDirectory(), pmd.isDeleted());
+this.isAuthoritativeDir = isAuthoritativeDir;
+  }
+
+  public DDBPathMetadata(PathMetadata pmd) {
+super(pmd.getFileStatus(), pmd.isEmptyDirectory(), pmd.isDeleted());
+this.isAuthoritativeDir = false;
+  }
+
+  public DDBPathMetadata(FileStatus fileStatus) {
+super(fileStatus);
+this.isAuthoritativeDir = false;
+  }
+
+  public DDBPathMetadata(FileStatus fileStatus, Tristate isEmptyDir,
+  boolean isDeleted) {
+super(fileStatus, isEmptyDir, isDeleted);
+this.isAuthoritativeDir = false;
+  }
+
+  public DDBPathMetadata(FileStatus fileStatus, Tristate isEmptyDir,
+  boolean isDeleted, boolean isAuthoritativeDir) {
+super(fileStatus, isEmptyDir, isDeleted);
+this.isAuthoritativeDir = isAuthoritativeDir;
+  }
+
+  public boolean isAuthoritativeDir() {
+return isAuthoritativeDir;
+  }
+
+  public void setAuthoritativeDir(boolean authoritativeDir) {
+isAuthoritativeDir = authoritativeDir;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+return super.equals(o);
+  }
+
+  @Override public int hashCode() {
+return super.hashCode();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7232857/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
--
diff --git 
a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
 
b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
index ba80b88..ddb493f 100644
---