This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val storeOp = new StoreOperation.Builder(location).withContent(ro).withW(1).withTimeout(1500).build() | |
riakCluster.operationComplete(storeOp, 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new String(Base64.decodeBase64(new String(Base64.encodeBase64("123".getBytes, false)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val foo = new RiakObjectBuilder().withContentType("application/json").withValue("{'key':'value'}").build() | |
riak.fetchBucket("foofoo").execute().store(foo).execute() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Xmn2g | |
-XX:+PrintGCTimeStamps | |
-XX:+PrintGCDetails | |
-Xloggc:/opt/es-debug/gc.log -XX:+PrintGCDateStamps | |
-XX:+PrintGCApplicationStoppedTime | |
-XX:+PrintGCApplicationConcurrentTime | |
-XX:+PrintSafepointStatistics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── README.md | |
├── pom.xml | |
└── src | |
└── main | |
├── java | |
│ └── stormapplied | |
│ └── creditcard | |
│ ├── LocalTopologyRunner.java | |
│ ├── Order.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
├── README.md | |
├── pom.xml | |
└── src | |
└── main | |
├── java | |
│ └── stormapplied | |
│ └── githubcommits | |
│ ├── LocalTopologyRunner.java | |
│ └── topology | |
│ ├── CommitFeedListener.java |