Repository: jclouds
Updated Branches:
  refs/heads/master b6920ca44 -> 86e947dde


Revert "Always return ETag from filesystem object store"

This reverts commit 496e27f1afa32b90d0656c3f21387cf68a30cb31.  This
commit imposed too much computational overhead when listing blobs.


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/86e947dd
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/86e947dd
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/86e947dd

Branch: refs/heads/master
Commit: 86e947ddedfa1a13976f9debeadae1da6f2f0190
Parents: b6920ca
Author: Andrew Gaul <[email protected]>
Authored: Thu Jan 28 19:24:23 2016 -0800
Committer: Andrew Gaul <[email protected]>
Committed: Thu Jan 28 23:04:12 2016 -0800

----------------------------------------------------------------------
 .../internal/FilesystemStorageStrategyImpl.java |  5 ----
 .../FilesystemStorageStrategyImplTest.java      | 30 --------------------
 2 files changed, 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/86e947dd/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
----------------------------------------------------------------------
diff --git 
a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
 
b/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
index 5cab591..3782b99 100644
--- 
a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
+++ 
b/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
@@ -371,11 +371,6 @@ public class FilesystemStorageStrategyImpl implements 
LocalStorageStrategy {
                
userMetadata.put(attribute.substring(XATTR_USER_METADATA_PREFIX.length()), 
value);
             }
 
-            if (hashCode == null) {
-                // content-md5 xattr not found; recompute
-                hashCode = byteSource.hash(Hashing.md5());
-            }
-
             builder.payload(byteSource)
                .cacheControl(cacheControl)
                .contentDisposition(contentDisposition)

http://git-wip-us.apache.org/repos/asf/jclouds/blob/86e947dd/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
----------------------------------------------------------------------
diff --git 
a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
 
b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
index 2540e42..19ca7d9 100644
--- 
a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
+++ 
b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
@@ -16,7 +16,6 @@
  */
 package org.jclouds.filesystem.strategy.internal;
 
-import static com.google.common.io.BaseEncoding.base16;
 import static org.jclouds.filesystem.util.Utils.isMacOSX;
 import static org.jclouds.utils.TestUtils.randomByteSource;
 import static org.testng.Assert.assertEquals;
@@ -56,8 +55,6 @@ import com.google.common.base.Supplier;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
-import com.google.common.hash.HashCode;
-import com.google.common.hash.Hashing;
 import com.google.common.io.ByteSource;
 import com.google.common.io.Files;
 import com.google.common.util.concurrent.Uninterruptibles;
@@ -670,27 +667,6 @@ public class FilesystemStorageStrategyImplTest {
       assertFalse(blob.getMetadata().getUserMetadata().containsKey("key1"));
    }
 
-   // This test will become irrelevant if the JVM starts supporting
-   // user extended attributes on HFS+. Nobody will complain.
-   @Test(dataProvider = "onlyOnMacOSX")
-   public void testEtagReturnedWithoutXattrSupport() throws Exception {
-      String blobKey = TestUtils.createRandomBlobKey();
-      ByteSource content = randomByteSource().slice(0, 1024);
-      HashCode expectedHash = content.hash(Hashing.md5());
-
-      // write blob
-      Blob blob = new BlobBuilderImpl()
-            .name(blobKey)
-            .payload(content)
-            .build();
-      String etag = storageStrategy.putBlob(CONTAINER_NAME, blob);
-
-      // read blob & check etag
-      blob = storageStrategy.getBlob(CONTAINER_NAME, blobKey);
-      
assertEquals(blob.getMetadata().getContentMetadata().getContentMD5AsHashCode(), 
expectedHash);
-      assertEquals(blob.getMetadata().getETag(), 
base16().lowerCase().encode(expectedHash.asBytes()));
-   }
-
    // ---------------------------------------------------------- Private 
methods
 
    /**
@@ -710,10 +686,4 @@ public class FilesystemStorageStrategyImplTest {
         return isMacOSX() ? TestUtils.NO_INVOCATIONS
                 : TestUtils.SINGLE_NO_ARG_INVOCATION;
    }
-
-  @DataProvider
-  public Object[][] onlyOnMacOSX() {
-      return isMacOSX() ?
-          TestUtils.SINGLE_NO_ARG_INVOCATION : TestUtils.NO_INVOCATIONS;
-  }
 }

Reply via email to