Skip to content

Instantly share code, notes, and snippets.

View SeanTAllen's full-sized avatar
🐴
Seriouspony

Sean T Allen SeanTAllen

🐴
Seriouspony
View GitHub Profile
@SeanTAllen
SeanTAllen / gist:9726722
Created March 23, 2014 17:43
So does this max out at 4.5 seconds max value for operationComplete ?
val storeOp = new StoreOperation.Builder(location).withContent(ro).withW(1).withTimeout(1500).build()
riakCluster.operationComplete(storeOp, 3)
@SeanTAllen
SeanTAllen / gist:9723440
Created March 23, 2014 14:02
How I understand timeouts
withTimeout on StoreOperation is how long to allow for the store complete.
get(t,u) is how long we would wait on it completing.
if the get timeout is less than withTimeout for StoreOperation, the operation might still complete but we wouldn't be waiting for confirmation.
is that correct?
@SeanTAllen
SeanTAllen / gist:9718497
Last active August 29, 2015 13:57
I do this, I see the header x-riak-index-jobseeker_int: 3018394 but searching that index returns no keys
package com.theladders.match_jobseekers_with_jobs;
import com.basho.riak.client.query.RiakObject;
import com.basho.riak.client.query.indexes.LongIntIndex;
public class IndexAdder
{
public static void addLongIntIndex(RiakObject ro, String name, Long value) {
ro.getIndexes()
.getIndex(new LongIntIndex.Name(name))
@SeanTAllen
SeanTAllen / gist:9718356
Created March 23, 2014 03:45
fuck clever
the scala:
val payload = BinaryValue.create(pairs.asJson())
val ro: RiakObject = new RiakObject().setContentType("application/json").setValue(payload)
IndexAdder.addLongIntIndex(ro, "jobseeker", jobseekerId)
the solutions other part:
package com.theladders.match_jobseekers_with_jobs;
@SeanTAllen
SeanTAllen / gist:9716311
Last active August 29, 2015 13:57
No index...
val payload = BinaryValue.create(pairs.asJson())
val ro = new RiakObject().setContentType("application/json").setValue(payload)
ro.getUserMeta.put(BinaryValue.createFromUtf8("x-riak-index-jobseeker_int"), BinaryValue.createFromUtf8(jobseekerId.toString))
val storeOp = new StoreOperation.Builder(location).withContent(ro).build()
riakCluster.execute(storeOp)
I see the header set but when I try to look up the value by the index, I can't find. Thoughts?
new String(Base64.decodeBase64(new String(Base64.encodeBase64("123".getBytes, false))))
val foo = new RiakObjectBuilder().withContentType("application/json").withValue("{'key':'value'}").build()
riak.fetchBucket("foofoo").execute().store(foo).execute()
-Xmn2g
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
-Xloggc:/opt/es-debug/gc.log -XX:+PrintGCDateStamps
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintSafepointStatistics
@SeanTAllen
SeanTAllen / gist:8188573
Created December 30, 2013 21:37
Correct file layout for Chapter 4 of Storm Applied
.
├── README.md
├── pom.xml
└── src
└── main
├── java
│   └── stormapplied
│   └── creditcard
│   ├── LocalTopologyRunner.java
│   ├── Order.java
@SeanTAllen
SeanTAllen / gist:8188562
Created December 30, 2013 21:36
Correct file layout for Chapter 2 of Storm Applied
├── README.md
├── pom.xml
└── src
└── main
├── java
│   └── stormapplied
│   └── githubcommits
│   ├── LocalTopologyRunner.java
│   └── topology
│   ├── CommitFeedListener.java