Skip to content
Permalink
Browse files
JCLOUDS-641 swift is not immediately consistent.
  • Loading branch information
Adrian Cole authored and Adrian Cole committed Oct 8, 2014
1 parent 90b4367 commit 5ca24a8f1e212c60e01f93ca45179afff9f55c1a
Showing 2 changed files with 6 additions and 7 deletions.
@@ -18,12 +18,10 @@

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.Constants.PROPERTY_USER_THREADS;

import java.util.Set;

import javax.inject.Inject;
import javax.inject.Named;

import org.jclouds.Context;
import org.jclouds.blobstore.BlobRequestSigner;
@@ -38,7 +36,6 @@
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.reflect.TypeToken;
import com.google.common.util.concurrent.ListeningExecutorService;

/**
* Implementation of {@link BlobStoreContext} which allows you to employ
@@ -99,25 +96,25 @@ protected void checkRegionId(String regionId) {
private final Function<String, BlobStore> blobStore;
private final Function<String, BlobRequestSigner> blobRequestSigner;
private final Utils utils;
private final ListeningExecutorService executor;
private final ConsistencyModel consistencyModel;

@Inject
public RegionScopedBlobStoreContext(@Provider Context backend, @Provider TypeToken<? extends Context> backendType,
@Region Supplier<Set<String>> regionIds, @Region Supplier<String> implicitRegionId,
Function<String, BlobStore> blobStore, Function<String, BlobRequestSigner> blobRequestSigner, Utils utils,
@Named(PROPERTY_USER_THREADS) ListeningExecutorService executor) {
ConsistencyModel consistencyModel) {
super(backend, backendType);
this.regionIds = checkNotNull(regionIds, "regionIds");
this.implicitRegionId = checkNotNull(implicitRegionId, "implicitRegionId");
this.blobStore = checkNotNull(blobStore, "blobStore");
this.blobRequestSigner = checkNotNull(blobRequestSigner, "blobRequestSigner");
this.utils = checkNotNull(utils, "utils");
this.executor = checkNotNull(executor, "executor");
this.consistencyModel = checkNotNull(consistencyModel, "consistencyModel");
}

@Override
public ConsistencyModel getConsistencyModel() {
return ConsistencyModel.EVENTUAL;
return consistencyModel;
}

@Override
@@ -20,6 +20,7 @@

import org.jclouds.blobstore.BlobStore;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.blobstore.attr.ConsistencyModel;
import org.jclouds.openstack.swift.v1.blobstore.RegionScopedBlobStoreContext;
import org.jclouds.openstack.swift.v1.blobstore.RegionScopedSwiftBlobStore;

@@ -33,6 +34,7 @@ public class SwiftBlobStoreContextModule extends AbstractModule {

@Override
protected void configure() {
bind(ConsistencyModel.class).toInstance(ConsistencyModel.EVENTUAL);
bind(BlobStoreContext.class).to(RegionScopedBlobStoreContext.class);
install(new FactoryModuleBuilder().build(Factory.class));
}

0 comments on commit 5ca24a8

Please sign in to comment.