Skip to content

Instantly share code, notes, and snippets.

{
"query": {
"match_all": {}
},
"size": 0,
"facets": {
"tags": {
"terms": {
"field": "addr_city.untouched",
"size": 200
@rkroll
rkroll / gist:5583915
Created May 15, 2013 13:13
No Parcel Geocode
<GeocodeEntity Id="200000095269">
<GeocodeRequest>
<Address AddressLine="21691 CYPRESS RD APT 16B" AdminDistrict="FL" Locality="BOCA RATON" PostalCode="33433-3343"/>
</GeocodeRequest>
<GeocodeResponse Name="21691 Cypress Rd, Boca Raton, FL 33433" EntityType="Address" Confidence="High" MatchCodes="Good">
<Address AddressLine="21691 Cypress Rd" AdminDistrict="FL" CountryRegion="United States"
AdminDistrict2="Palm Beach Co." FormattedAddress="21691 Cypress Rd, Boca Raton, FL 33433"
Locality="Boca Raton" PostalCode="33433"/>
<GeocodePoint CalculationMethod="InterpolationOffset" Latitude="26.3528671860695" Longitude="-80.1781200617552"
Type="Point" UsageTypes="Display"/>
@rkroll
rkroll / gist:5444957
Created April 23, 2013 16:08
Run a faunus job
final String file = "bin/titan-cassandra-input.properties";
final Properties fileConfiguration = new Properties();
final Properties commandLineConfiguration = new Properties();
fileConfiguration.load(new FileInputStream(file));
final Configuration conf = new Configuration();
for (Map.Entry<Object, Object> entry : fileConfiguration.entrySet()) {
conf.set(entry.getKey().toString(), entry.getValue().toString());
}
@rkroll
rkroll / faunus_cassandra.pom.diff
Created April 18, 2013 18:11
faunus pom.xml diff
faunus_pom.xml.diff
diff --git a/bin/titan-cassandra-input.properties b/bin/titan-cassandra-input.properties
index 073ca9b..4b92305 100644
--- a/bin/titan-cassandra-input.properties
+++ b/bin/titan-cassandra-input.properties
@@ -1,6 +1,7 @@
# input graph parameters
faunus.graph.input.format=com.thinkaurelius.faunus.formats.titan.cassandra.TitanCassandraInputFormat
faunus.graph.input.titan.storage.backend=com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftStoreManager
+#faunus.graph.input.titan.storage.backend=com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxStoreManager
TitanGraph g = titanGraphService.getSingleton()
In a job:
while(true) {
Vertex vertex = g.addVertex(null);
vertex.setProperty("foo", "bar");
batchCount++;
if(batchCount % 1000 == 0) { g.commit() }
}
Server Software: Jetty(7.4.5.v20110725)
Server Hostname: localhost
Server Port: 8080
Document Path: /short-sale/
Document Length: 55071 bytes
Concurrency Level: 100
Time taken for tests: 71.724 seconds
Complete requests: 10000
@rkroll
rkroll / gist:5215263
Created March 21, 2013 18:09
ES-array-field-query
curl -XPUT 'http://localhost:9200/demo/index/loc' -d '{
"locations" : [
"Oakland Park, FLORIDA",
"33309",
"Florida"
]
}'
curl -XGET 'http://localhost:9200/demo/_search?' -d '
{
@rkroll
rkroll / es-oom-stacktrace
Created March 21, 2013 14:31
ES-OOM-Stacktrace
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:640)
at java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(ThreadPoolExecutor.java:727)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:657)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker.start(DeadLockProofWorker.java:38)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.openSelector(AbstractNioWorker.java:204)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.<init>(AbstractNioWorker.java:127)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.<init>(NioWorker.java:40)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorkerPool.createWorker(NioWorkerPool.java:34)
private static final String[] ABSTRACT_MODEL_PROPERTIES_TO_IGNORE_ON_COPY;
static {
ArrayList<String> abstractModelPropertiesList = new ArrayList<String>();
for (PropertyDescriptor propertyDescriptor : BeanUtils.getPropertyDescriptors(AbstractModel.class)) {
abstractModelPropertiesList.add(propertyDescriptor.getName());
}
ABSTRACT_MODEL_PROPERTIES_TO_IGNORE_ON_COPY = abstractModelPropertiesList.toArray(new String[abstractModelPropertiesList.size()]);
}
Result[0]
90543
Spruce Dr
Lewiston
Montmorency Co.
49756
MI
44.8851432800293
-84.31549835205078