You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ec...@apache.org on 2016/05/17 16:05:23 UTC
[1/2] hbase git commit: HBASE-15826 Clean up ASF license issues
Repository: hbase
Updated Branches:
refs/heads/HBASE-14850 e0025533c -> 20f43d2f5
HBASE-15826 Clean up ASF license issues
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2508b03a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2508b03a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2508b03a
Branch: refs/heads/HBASE-14850
Commit: 2508b03a1b4e89ba9d849ac1de2d4e09938f622d
Parents: e002553
Author: Elliott Clark <ec...@apache.org>
Authored: Fri May 13 14:53:47 2016 -0700
Committer: Elliott Clark <ec...@apache.org>
Committed: Tue May 17 09:04:52 2016 -0700
----------------------------------------------------------------------
hbase-native-client/Makefile | 17 +++++++++++++++++
hbase-native-client/bin/copy-protobuf.sh | 16 ++++++++++++++++
hbase-native-client/bin/format-code.sh | 16 ++++++++++++++++
hbase-native-client/bin/start-local-hbase.sh | 1 -
hbase-native-client/hbase.doxygen | 22 +++++++++++++++++++---
hbase-native-client/serde/server-name.h | 19 +++++++++++++++++++
6 files changed, 87 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/2508b03a/hbase-native-client/Makefile
----------------------------------------------------------------------
diff --git a/hbase-native-client/Makefile b/hbase-native-client/Makefile
index 90ec6ea..826233f 100644
--- a/hbase-native-client/Makefile
+++ b/hbase-native-client/Makefile
@@ -1,3 +1,20 @@
+##
+# 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.
+
build:
$(shell buck build core/... )
http://git-wip-us.apache.org/repos/asf/hbase/blob/2508b03a/hbase-native-client/bin/copy-protobuf.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/copy-protobuf.sh b/hbase-native-client/bin/copy-protobuf.sh
index c9e70f2..36541cf 100755
--- a/hbase-native-client/bin/copy-protobuf.sh
+++ b/hbase-native-client/bin/copy-protobuf.sh
@@ -1,4 +1,20 @@
#!/usr/bin/env bash
+##
+# 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.
set -euo pipefail
IFS=$'\n\t'
http://git-wip-us.apache.org/repos/asf/hbase/blob/2508b03a/hbase-native-client/bin/format-code.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/format-code.sh b/hbase-native-client/bin/format-code.sh
index 24d6515..36a114d 100755
--- a/hbase-native-client/bin/format-code.sh
+++ b/hbase-native-client/bin/format-code.sh
@@ -1,4 +1,20 @@
#!/usr/bin/env bash
+##
+# 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.
set -euo pipefail
IFS=$'\n\t'
http://git-wip-us.apache.org/repos/asf/hbase/blob/2508b03a/hbase-native-client/bin/start-local-hbase.sh
----------------------------------------------------------------------
diff --git a/hbase-native-client/bin/start-local-hbase.sh b/hbase-native-client/bin/start-local-hbase.sh
index 49637d6..12069c2 100755
--- a/hbase-native-client/bin/start-local-hbase.sh
+++ b/hbase-native-client/bin/start-local-hbase.sh
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
-
##
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
http://git-wip-us.apache.org/repos/asf/hbase/blob/2508b03a/hbase-native-client/hbase.doxygen
----------------------------------------------------------------------
diff --git a/hbase-native-client/hbase.doxygen b/hbase-native-client/hbase.doxygen
index 22e2d21..fef404c 100644
--- a/hbase-native-client/hbase.doxygen
+++ b/hbase-native-client/hbase.doxygen
@@ -1,4 +1,20 @@
# Doxyfile 1.8.11
+##
+# 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.
#---------------------------------------------------------------------------
# Project related configuration options
@@ -103,14 +119,14 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
INPUT =
INPUT_ENCODING = UTF-8
-FILE_PATTERNS =
+FILE_PATTERNS =
RECURSIVE = YES
EXCLUDE = third-party/ buck-out/
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = /*-test.cc
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
+EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
@@ -142,7 +158,7 @@ IGNORE_PREFIX =
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
-HTML_OUTPUT = html
+HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
http://git-wip-us.apache.org/repos/asf/hbase/blob/2508b03a/hbase-native-client/serde/server-name.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/serde/server-name.h b/hbase-native-client/serde/server-name.h
index 9844465..6551fdc 100644
--- a/hbase-native-client/serde/server-name.h
+++ b/hbase-native-client/serde/server-name.h
@@ -1,3 +1,22 @@
+/*
+ * 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.
+ *
+ */
+
#pragma once
#include "if/HBase.pb.h"
[2/2] hbase git commit: HBASE-15823 Use call once for user util
Posted by ec...@apache.org.
HBASE-15823 Use call once for user util
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/20f43d2f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/20f43d2f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/20f43d2f
Branch: refs/heads/HBASE-14850
Commit: 20f43d2f519d686f5497d3a28d6decd6e908febe
Parents: 2508b03
Author: Elliott Clark <ec...@apache.org>
Authored: Fri May 13 13:07:03 2016 -0700
Committer: Elliott Clark <ec...@apache.org>
Committed: Tue May 17 09:05:19 2016 -0700
----------------------------------------------------------------------
hbase-native-client/utils/user-util.cc | 13 ++-----------
hbase-native-client/utils/user-util.h | 6 ++----
2 files changed, 4 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/20f43d2f/hbase-native-client/utils/user-util.cc
----------------------------------------------------------------------
diff --git a/hbase-native-client/utils/user-util.cc b/hbase-native-client/utils/user-util.cc
index 3d963b3..9e170e0 100644
--- a/hbase-native-client/utils/user-util.cc
+++ b/hbase-native-client/utils/user-util.cc
@@ -27,22 +27,14 @@
using namespace hbase;
using namespace std;
-UserUtil::UserUtil() : init_{false}, user_name_{"drwho"}, m_() {}
+UserUtil::UserUtil() : once_flag_{}, user_name_{"drwho"} {}
string UserUtil::user_name() {
- if (!init_) {
- compute_user_name();
- }
+ std::call_once(once_flag_, [this]() { compute_user_name(); });
return user_name_;
}
void UserUtil::compute_user_name() {
- lock_guard<mutex> lock(m_);
-
- if (init_) {
- return;
- }
-
// According to the man page of getpwuid
// this should never be free'd
//
@@ -52,6 +44,5 @@ void UserUtil::compute_user_name() {
// make sure that we got something.
if (passwd && passwd->pw_name) {
user_name_ = string{passwd->pw_name};
- init_ = true;
}
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/20f43d2f/hbase-native-client/utils/user-util.h
----------------------------------------------------------------------
diff --git a/hbase-native-client/utils/user-util.h b/hbase-native-client/utils/user-util.h
index 0b4cc73..fdfc0c8 100644
--- a/hbase-native-client/utils/user-util.h
+++ b/hbase-native-client/utils/user-util.h
@@ -19,8 +19,7 @@
#pragma once
-#include <atomic>
-#include <memory>
+#include <string>
#include <mutex>
namespace hbase {
@@ -49,8 +48,7 @@ private:
* Compute the username. This will block.
*/
void compute_user_name();
- std::atomic<bool> init_;
+ std::once_flag once_flag_;
std::string user_name_;
- std::mutex m_;
};
} // namespace hbase