Github user joshelser commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/106#discussion_r65483843
  
    --- Diff: 
core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java 
---
    @@ -81,38 +89,60 @@ public void flush() throws IOException {
        * Compression algorithms.
        */
       public static enum Algorithm {
    +
         LZO(COMPRESSION_LZO) {
    -      private transient boolean checked = false;
    +      private AtomicBoolean checked = new AtomicBoolean(false);
           private static final String defaultClazz = 
"org.apache.hadoop.io.compress.LzoCodec";
           private transient CompressionCodec codec = null;
     
    +      /**
    +       * Configuration option for LZO buffer size
    +       */
    +      private static final String BUFFER_SIZE_OPT = 
"io.compression.codec.lzo.buffersize";
    +
    +      /**
    +       * Default buffer size
    +       */
    +      private static final int DEFAULT_BUFFER_SIZE = 64 * 1024;
    +
           @Override
    -      public synchronized boolean isSupported() {
    --- End diff --
    
    Isn't this changing the semantics of this method? If I call 
`Algorithm.LZO.isSupported()` before trying to create a codec, it would now 
return `false` instead of `true` (assuming I have the library available). I 
could also be really tired and missing something obvious, but I'm guessing that 
there's something to do with how we call this code that makes it work properly?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to