You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2015/07/24 12:30:43 UTC

jena git commit: More fixes for JENA-977

Repository: jena
Updated Branches:
  refs/heads/master 968f7e0a3 -> 8b6a36dd2


More fixes for JENA-977

- Disable pipe viewer usage for the time being since it hangs some
  terminals
- Tone done some warnings to just debug level messages
- Clean up output of free for Linux 3.x kernels
- Only try to use free if running a Linux kernel


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

Branch: refs/heads/master
Commit: 8b6a36dd2703c1d6e9ed893ef9ecd1f06358d712
Parents: 968f7e0
Author: Rob Vesse <rv...@apache.org>
Authored: Fri Jul 24 11:28:40 2015 +0100
Committer: Rob Vesse <rv...@apache.org>
Committed: Fri Jul 24 11:30:21 2015 +0100

----------------------------------------------------------------------
 apache-jena/bin/tdbloader2common | 11 ++++++++++-
 apache-jena/bin/tdbloader2index  | 26 +++++++++++++++-----------
 2 files changed, 25 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/8b6a36dd/apache-jena/bin/tdbloader2common
----------------------------------------------------------------------
diff --git a/apache-jena/bin/tdbloader2common b/apache-jena/bin/tdbloader2common
index c6076b7..6bdb8a8 100644
--- a/apache-jena/bin/tdbloader2common
+++ b/apache-jena/bin/tdbloader2common
@@ -95,12 +95,21 @@ function getFreeMem() {
       FREE_MEM=${FREE_MEM%M}
       FREE_MEM=$(($FREE_MEM * 1024 * 1024))
       ;;
-    *)
+    linux*)
       # Try to use free if available
       which free >/dev/null 2>&1
       if [ $? -eq 0 ]; then
         # Have free available
         FREE_MEM=$(free -b)
+
+        # Check the output
+        # 2.x kernels produce just an integer
+        # 3.x kernels produce detailed information
+        case "$FREE_MEM" in
+          ''|*[!0-9]*)
+            # Clean up free output on 3.x kernels
+            FREE_MEM=$(echo "$FREE_MEM" | tail -n +2 | head | awk '{print $4}')
+        esac
       fi
       ;;
   esac

http://git-wip-us.apache.org/repos/asf/jena/blob/8b6a36dd/apache-jena/bin/tdbloader2index
----------------------------------------------------------------------
diff --git a/apache-jena/bin/tdbloader2index b/apache-jena/bin/tdbloader2index
index d2b6ed8..eca1aae 100755
--- a/apache-jena/bin/tdbloader2index
+++ b/apache-jena/bin/tdbloader2index
@@ -269,15 +269,19 @@ info "Index Building Phase"
 # Check whether Pipe Viewer is available
 # Needs to temporarily disable exit on error as which produces an error
 # if the given command is not found
-set +e
-which pv >/dev/null 2>&1
-HAS_PV=$?
-set -e
-if [ $HAS_PV = 0 ]; then
-  debug "pv (Pipe Viewer) available on your system so sorts will show progres"
-else
-  debug "No pv (Pipe Viewer) on your system so sorts will show no progress"
-fi
+#set +e
+#which pv >/dev/null 2>&1
+#HAS_PV=$?
+#set -e
+#if [ $HAS_PV = 0 ]; then
+#  debug "pv (Pipe Viewer) available on your system so sorts will show progres"
+#else
+#  debug "No pv (Pipe Viewer) on your system so sorts will show no progress"
+#fi
+
+# TODO Pipe Viewer causes hangs in some terminals so currently disabled by default
+# May be manually enabled by setting HAS_PV to zero in your environment
+HAS_PV=${HAS_PV:-1}
 
 # Check where we are storing temporary sort files
 debug "Sort Arguments: $SORT_ARGS"
@@ -345,7 +349,7 @@ generate_index()
     FREE_MEM=$(getFreeMem)
     if [ "$FREE_MEM" -ge 0 ]; then
       if [ "$SIZE" -ge "$FREE_MEM" ]; then
-        warn "Insufficient free memory to sort data in-memory, sort will need to perform an external sort using Temp Directory ${SORT_TEMP_DIR}"
+        debug "Insufficient free memory to sort data in-memory, sort will need to perform an external sort using Temp Directory ${SORT_TEMP_DIR}"
 
         # Check for disk space on temporary disk
         SORT_DRIVE_INFO=($(getDriveInfo "${SORT_TEMP_DIR}"))
@@ -358,7 +362,7 @@ generate_index()
         debug "Should be sufficient free memory ($FREE_MEM bytes) for sort to be fully in-memory"
       fi
     else
-      warn "Unable to determine free memory on your OS, can't check whether sort will be in-memory or external sort using Temp Directory ${SORT_TEMP_DIR}"
+      debug "Unable to determine free memory on your OS, can't check whether sort will be in-memory or external sort using Temp Directory ${SORT_TEMP_DIR}"
     fi
 
     # Sort the input data