Skip to content

Commit

Permalink
Changed info debugging to trace debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jzgithub1 committed Oct 29, 2019
1 parent d21ee7d commit 04fdeb6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
28 changes: 16 additions & 12 deletions core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,32 +225,33 @@ private synchronized void processTableConfigurationItem(WatchedEvent event) {
try {
Stat versionStat = getZooKeeper().exists(event.getPath(), watcher);
if (versionStat == null) {
log.info("NodeDataChanged table_configs zoonode did not exist yet and stat was null");
return;
}

byte[] configToRefresh = getZooKeeper().getData(event.getPath(), true, versionStat);

if (configToRefresh == null) {
log.info("Config to refresh was null");
return;
}

if ((versionStat != null) && (versionStat.getVersion() - lastTableConfigVersion == 1)) {
lastTableConfigVersion = versionStat.getVersion();
refreshTableConfig(configToRefresh);
log.info("Successfully refreshed table config (the elegant way way): "
+ new String(configToRefresh));
log.info("The next version of tableconfigs is being processed consecutively. ");
if (log.isTraceEnabled()) {
log.trace("Successfully refreshed table config (the most efficient way way): "
+ new String(configToRefresh));
log.trace("The next version of tableconfigs is being processed consecutively. ");
}
} else {
log.info("We have to update table configs in ugly way");

if (log.isTraceEnabled()) {
log.trace("We have to update all table configs.");
}

if (versionStat != null) {
log.info("lastTableConfigVersion is: " + lastTableConfigVersion
+ " current table config version is: " + versionStat.getVersion());
lastTableConfigVersion = versionStat.getVersion();
updateAllTableConfigurations();
}

}

} catch (Exception e) {
Expand Down Expand Up @@ -320,7 +321,8 @@ private synchronized void setWatcherForTableConfigVersion(WatchedEvent event) {
if (versionStat != null) {
lastTableConfigVersion = versionStat.getVersion();
tableConfigWatcherSet = true;
log.info("Successfully set table_config watcher");
if (log.isTraceEnabled())
log.trace("Successfully set table_config watcher");
}

} catch (KeeperException ke) {
Expand All @@ -347,8 +349,10 @@ private void refreshTableConfig(byte[] configToRefresh) {
if (!tableConfigMatcher.matches())
return;

log.info("NodeDataChanged called refreshTableConfig and refreshed table config: "
+ new String(configToRefresh));
if (log.isTraceEnabled()) {
log.trace("NodeDataChanged called refreshTableConfig and refreshed table config: "
+ new String(configToRefresh));
}

remove(strConfigToRefresh);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public static boolean setTableProperty(ZooReaderWriter zoo, String zkRoot, Table
String zPath = zkTablePath + "/" + property;
zoo.putPersistentData(zPath, value.getBytes(UTF_8), NodeExistsPolicy.OVERWRITE);
updateTableConfigTrackingZnode(zPath, zoo);
log.info("updateTableConfigTrackingZnode called in setTableProperty " + zPath);
if (log.isTraceEnabled()) {
log.trace("updateTableConfigTrackingZnode called in setTableProperty for " + zPath);
}
return true;
}

Expand All @@ -70,7 +72,9 @@ public static void removeTableProperty(ServerContext context, TableId tableId, S
String zPath = getTablePath(context.getZooKeeperRoot(), tableId) + "/" + property;
context.getZooReaderWriter().recursiveDelete(zPath, NodeMissingPolicy.SKIP);
updateTableConfigTrackingZnode(zPath, context.getZooReaderWriter());
log.info("updateTableConfigTrackingZnode called in removeTableProperty " + zPath);
if (log.isTraceEnabled()) {
log.trace("updateTableConfigTrackingZnode called in removeTableProperty " + zPath);
}
}

private static String getTablePath(String zkRoot, TableId tableId) {
Expand Down

0 comments on commit 04fdeb6

Please sign in to comment.