Change in asterixdb[master]: Fix Logging Of Metadata Stores

2016-10-13 Thread Michael Blow (Code Review)
Michael Blow has submitted this change and it was merged.

Change subject: Fix Logging Of Metadata Stores
..


Fix Logging Of Metadata Stores

Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1279
Sonar-Qube: Jenkins 
Tested-by: Jenkins 
Integration-Tests: Jenkins 
Reviewed-by: Till Westmann 
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
A 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
2 files changed, 50 insertions(+), 1 deletion(-)

Approvals:
  Till Westmann: Looks good to me, approved
  Jenkins: Verified; No violations found; Verified



diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
index e6f3142..ea1f714 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
@@ -39,6 +39,7 @@
 import org.apache.asterix.common.replication.IRemoteRecoveryManager;
 import org.apache.asterix.common.transactions.IRecoveryManager;
 import org.apache.asterix.common.transactions.IRecoveryManager.SystemState;
+import org.apache.asterix.common.utils.PrintUtil;
 import org.apache.asterix.common.utils.StoragePathUtil;
 import org.apache.asterix.event.schema.cluster.Cluster;
 import org.apache.asterix.event.schema.cluster.Node;
@@ -209,7 +210,7 @@
 if (LOGGER.isLoggable(Level.INFO)) {
 LOGGER.info("System state: " + SystemState.NEW_UNIVERSE);
 LOGGER.info("Node ID: " + nodeId);
-LOGGER.info("Stores: " + metadataProperties.getStores());
+LOGGER.info("Stores: " + 
PrintUtil.toString(metadataProperties.getStores()));
 LOGGER.info("Root Metadata Store: " + 
metadataProperties.getStores().get(nodeId)[0]);
 }
 
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
new file mode 100644
index 000..8c0e4ff
--- /dev/null
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
@@ -0,0 +1,48 @@
+/*
+ * 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.asterix.common.utils;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
+
+public class PrintUtil {
+private PrintUtil() {
+}
+
+public static String toString(Map map) {
+Iterator> iter = 
map.entrySet().iterator();
+if (!iter.hasNext()) {
+return "{}";
+}
+StringBuilder sb = new StringBuilder();
+sb.append('{');
+while (true) {
+Map.Entry entry = iter.next();
+sb.append(entry.getKey());
+sb.append('=');
+sb.append(Arrays.toString(entry.getValue()));
+if (! iter.hasNext()) {
+break;
+}
+sb.append(',').append(' ');
+}
+return sb.append('}').toString();
+}
+}

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1279
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow 
Gerrit-Reviewer: Jenkins 
Gerrit-Reviewer: Michael Blow 
Gerrit-Reviewer: Till Westmann 


Change in asterixdb[master]: Fix Logging Of Metadata Stores

2016-10-13 Thread Till Westmann (Code Review)
Till Westmann has posted comments on this change.

Change subject: Fix Logging Of Metadata Stores
..


Patch Set 2: Code-Review+2

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1279
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow 
Gerrit-Reviewer: Jenkins 
Gerrit-Reviewer: Till Westmann 
Gerrit-HasComments: No


Change in asterixdb[master]: Fix Logging Of Metadata Stores

2016-10-13 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Fix Logging Of Metadata Stores
..


Patch Set 2: Integration-Tests+1

Integration Tests Successful

https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/910/ : 
SUCCESS

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1279
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow 
Gerrit-Reviewer: Jenkins 
Gerrit-Reviewer: Till Westmann 
Gerrit-HasComments: No


Change in asterixdb[master]: Fix Logging Of Metadata Stores

2016-10-13 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Fix Logging Of Metadata Stores
..


Patch Set 2:

Integration Tests Started 
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/910/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1279
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow 
Gerrit-Reviewer: Jenkins 
Gerrit-Reviewer: Till Westmann 
Gerrit-HasComments: No


Change in asterixdb[master]: Fix Logging Of Metadata Stores

2016-10-13 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Fix Logging Of Metadata Stores
..


Patch Set 2:

Build Started 
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/3003/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1279
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow 
Gerrit-Reviewer: Jenkins 
Gerrit-Reviewer: Till Westmann 
Gerrit-HasComments: No


Change in asterixdb[master]: Fix Logging Of Metadata Stores

2016-10-13 Thread Michael Blow (Code Review)
Hello Jenkins,

I'd like you to reexamine a change.  Please visit

https://asterix-gerrit.ics.uci.edu/1279

to look at the new patch set (#2).

Change subject: Fix Logging Of Metadata Stores
..

Fix Logging Of Metadata Stores

Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
A 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
2 files changed, 50 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/79/1279/2
-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1279
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow 
Gerrit-Reviewer: Jenkins 
Gerrit-Reviewer: Till Westmann 


Change in asterixdb[master]: Fix Logging Of Metadata Stores

2016-10-13 Thread Jenkins (Code Review)
Jenkins has posted comments on this change.

Change subject: Fix Logging Of Metadata Stores
..


Patch Set 1:

Build Started 
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/3002/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1279
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow 
Gerrit-Reviewer: Jenkins 
Gerrit-HasComments: No


Change in asterixdb[master]: Fix Logging Of Metadata Stores

2016-10-13 Thread Michael Blow (Code Review)
Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1279

Change subject: Fix Logging Of Metadata Stores
..

Fix Logging Of Metadata Stores

Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
A 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
2 files changed, 47 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/79/1279/1

diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
index e6f3142..ea1f714 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplicationEntryPoint.java
@@ -39,6 +39,7 @@
 import org.apache.asterix.common.replication.IRemoteRecoveryManager;
 import org.apache.asterix.common.transactions.IRecoveryManager;
 import org.apache.asterix.common.transactions.IRecoveryManager.SystemState;
+import org.apache.asterix.common.utils.PrintUtil;
 import org.apache.asterix.common.utils.StoragePathUtil;
 import org.apache.asterix.event.schema.cluster.Cluster;
 import org.apache.asterix.event.schema.cluster.Node;
@@ -209,7 +210,7 @@
 if (LOGGER.isLoggable(Level.INFO)) {
 LOGGER.info("System state: " + SystemState.NEW_UNIVERSE);
 LOGGER.info("Node ID: " + nodeId);
-LOGGER.info("Stores: " + metadataProperties.getStores());
+LOGGER.info("Stores: " + 
PrintUtil.toString(metadataProperties.getStores()));
 LOGGER.info("Root Metadata Store: " + 
metadataProperties.getStores().get(nodeId)[0]);
 }
 
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
new file mode 100644
index 000..91a29db
--- /dev/null
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/PrintUtil.java
@@ -0,0 +1,45 @@
+/*
+ * 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.asterix.common.utils;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
+
+public class PrintUtil {
+public static String toString(Map map) {
+Iterator> iter = 
map.entrySet().iterator();
+if (!iter.hasNext()) {
+return "{}";
+}
+StringBuilder sb = new StringBuilder();
+sb.append('{');
+while (true) {
+Map.Entry entry = iter.next();
+sb.append(entry.getKey());
+sb.append('=');
+sb.append(Arrays.toString(entry.getValue()));
+if (! iter.hasNext()) {
+break;
+}
+sb.append(',').append(' ');
+}
+return sb.append('}').toString();
+}
+}

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1279
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic40cb5f385441089ee1d3f868ddb5add404a6426
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow