accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubbsii <...@git.apache.org>
Subject [GitHub] accumulo pull request #227: ACCUMULO-4596 Stopped using ACCUMULO_HOME for na...
Date Fri, 03 Mar 2017 22:15:10 GMT
Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/227#discussion_r104252836
  
    --- Diff: server/tserver/src/main/java/org/apache/accumulo/tserver/NativeMap.java ---
    @@ -60,39 +60,44 @@
      * would be a mistake for long lived NativeMaps. Long lived objects are not garbage collected
quickly, therefore a process could easily use too much memory.
      *
      */
    -
     public class NativeMap implements Iterable<Map.Entry<Key,Value>> {
     
       private static final Logger log = LoggerFactory.getLogger(NativeMap.class);
       private static AtomicBoolean loadedNativeLibraries = new AtomicBoolean(false);
     
       // Load native library
       static {
    -    // Check standard directories
    -    List<File> directories = new ArrayList<>(Arrays.asList(new File[] {new
File("/usr/lib64"), new File("/usr/lib")}));
    -    // Check in ACCUMULO_HOME location, too
    -    String accumuloHome = System.getenv("ACCUMULO_HOME");
    -    if (accumuloHome != null) {
    -      directories.add(new File(accumuloHome + "/lib/native"));
    -      directories.add(new File(accumuloHome + "/lib/native/map")); // old location, just
in case somebody puts it here
    +    // Check in directories set by 'accumulo.native.lib.dirs' system property
    +    List<File> directories = new ArrayList<>();
    +    String accumuloNativeLibDirs = System.getProperty("accumulo.native.lib.dirs");
    +    if (accumuloNativeLibDirs != null) {
    +      for (String libDir : accumuloNativeLibDirs.split(":")) {
    +        directories.add(new File(libDir));
    +      }
         }
         // Attempt to load from these directories, using standard names
         loadNativeLib(directories);
     
         // Check LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on Mac)
         if (!isLoaded()) {
    +      log.error("Tried and failed to load Accumulo native library from " + accumuloNativeLibDirs);
           String ldLibraryPath = System.getProperty("java.library.path");
    -      String errMsg = "Tried and failed to load native map library from " + ldLibraryPath;
           try {
             System.loadLibrary("accumulo");
             loadedNativeLibraries.set(true);
    --- End diff --
    
    Really not sure we need this fall-back, but I guess it's not going to hurt to leave it
in for now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message