Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couchbase sync gateway #25

Merged
merged 5 commits into from Sep 1, 2014
Merged

Conversation

nakomis
Copy link
Contributor

@nakomis nakomis commented Jun 26, 2014

Resolves jira task BROOKLYN-9

@aledsage
Copy link
Contributor

aledsage commented Jul 8, 2014

@nakomis next time when you copy in @ZaidM 's work, can you ensure it's his commit that appears in the history. For example, fetch his remote branch and then cherry-pick his commit.


public class CouchbaseClusterImpl extends DynamicClusterImpl implements CouchbaseCluster {
private static final Logger log = LoggerFactory.getLogger(CouchbaseClusterImpl.class);
private final Object mutex = new Object[0];
private final HttpFeed[] resetBucketCreation = new HttpFeed[]{null};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why an array of size one? It looks like you're using it like an AtomicReference<HttpFeed> with get/set calls.

This field deserves a few lines of comments for what it's for - presumably it's allowing one to tell when the bucket creation has completed?

@nakomis
Copy link
Contributor Author

nakomis commented Jul 8, 2014

I would normally do this, however a rebase tool that @ZaidM had used caused
a problem with the commit history, so there wasn't a sensible set of
commits that I could cherry-pick in to get what I needed, which is why I
did it this way

On 8 July 2014 17:28, Aled Sage notifications@github.com wrote:

@nakomis https://github.com/Nakomis next time when you copy in @ZaidM
https://github.com/ZaidM 's work, can you ensure it's his commit that
appears in the history. For example, fetch his remote branch and then
cherry-pick his commit.


Reply to this email directly or view it on GitHub
#25 (comment)
.

Martin Harris
Lead Software Engineer
Cloudsoft Corporation Ltd
www.cloudsoftcorp.com
Mobile: +44 (0)7989 047-855

public void launch() {
Entity cbNode = entity.getConfig(CouchbaseSyncGateway.COUCHBASE_SERVER);
Entities.waitForServiceUp(cbNode, Duration.ONE_HOUR);
DependentConfiguration.waitInTaskForAttributeReady(cbNode, CouchbaseCluster.IS_CLUSTER_INITIALIZED, Predicates.equalTo(true));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will never return if the cbNode is a CouchbaseNode rather than a cluster - but the description for CouchbaseSyncGateway.COUCHBASE_SERVER says it can be either.

@aledsage
Copy link
Contributor

aledsage commented Jul 9, 2014

@nakomis finished reviewing this now - lots of great stuff; mostly minor comments. Ping me when it's ready for review again.

Entities.waitForServiceUp(cbNode, Duration.ONE_HOUR);
DependentConfiguration.waitInTaskForAttributeReady(cbNode, CouchbaseCluster.IS_CLUSTER_INITIALIZED, Predicates.equalTo(true));
// Even once the bucket has published its API URL, it can still take a couple of seconds for it to become available
Time.sleep(10 * 1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do Time.sleep(Duration.TEN_SECONDS)

@ahgittin
Copy link
Contributor

can you add an example yaml including sync gateway? (and possibly also a downstream app)

@ahgittin
Copy link
Contributor

i have some fixes for this but they now depend on #131 so i'll wait for that to be merged then also merge this

ahgittin added a commit to ahgittin/incubator-brooklyn that referenced this pull request Sep 1, 2014
Conflicts:
	software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java - connect enrichers was removed, fixed here
@ahgittin ahgittin mentioned this pull request Sep 1, 2014
@asfgit asfgit merged commit f23ee27 into apache:master Sep 1, 2014
@nakomis nakomis deleted the couchbase-sync-gateway branch September 29, 2014 13:56
@fatuhoku
Copy link
Contributor

Any updates for the YAML example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants