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 scratch; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class StartsWithPerf { | |
public static void main(String[] args) { | |
try { | |
new StartsWithPerf().go(); |
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
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.atomic.AtomicLong; | |
public class Main { | |
public static void main(String[] args) { | |
try { | |
new Main().doIt(); |
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
/* | |
* Copyright 2020 Confluent Inc. | |
* | |
* Licensed under the Confluent Community License (the "License"); you may not use | |
* this file except in compliance with the License. You may obtain a copy of the | |
* License at | |
* | |
* http://www.confluent.io/confluent-community-license | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
Tim-Foxs-MBP15:json_request tfox$ curl -X POST http://localhost:8088/query -H "Content-Type: application/json" -d '{ | |
"ksql": "SELECT * FROM riderLocations WHERE GEO_DISTANCE(latitude, longitude, 37.4133, -122.1162) <= 5 EMIT CHANGES;", | |
"streamsProperties": { | |
"ksql.streams.auto.offset.reset": "earliest" | |
} | |
}' | |
[{"header":{"queryId":"none","schema":"`ROWKEY` STRING, `PROFILEID` STRING, `LATITUDE` DOUBLE, `LONGITUDE` DOUBLE"}}, | |
{"row":{"columns":["4ab5cbad","4ab5cbad",37.3952,-122.0813]}}, | |
{"row":{"columns":["8b6eae59","8b6eae59",37.3944,-122.0813]}}, | |
{"row":{"columns":["4a7c7b41","4a7c7b41",37.4049,-122.0822]}}, |
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
(base) Tim-Foxs-MBP15:json_request tfox$ python pyreq.py | |
query | |
<Response [200]> | |
b'[' | |
b'{' | |
b'"' | |
b'h' | |
b'e' | |
b'a' | |
b'd' |
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
public class Http2NoTlsTest { | |
@Test | |
public void testHttp2NoTls() throws Exception { | |
Vertx vertx = Vertx.vertx(); | |
HttpServer server = | |
vertx.createHttpServer(new HttpServerOptions()); |
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
public <T> T deserialiseObject(final Buffer buffer, final HttpServerResponse response, | |
final Class<T> clazz) { | |
final ObjectMapper objectMapper = DatabindCodec.mapper(); | |
try { | |
final T t = objectMapper.readValue(buffer.getBytes(), clazz); | |
} catch (UnrecognizedPropertyException e) { | |
sendUnrecognisedPropertyError(e.getPropertyName(), response); | |
return null; | |
} catch (MismatchedInputException e) { | |
final int startIndex = e.getMessage().indexOf('\''); |
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
/* | |
* Copyright 2018 Confluent Inc. | |
* | |
* Licensed under the Confluent Community License (the "License"); you may not use | |
* this file except in compliance with the License. You may obtain a copy of the | |
* License at | |
* | |
* http://www.confluent.io/confluent-community-license | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Copyright 2018 Confluent Inc. | |
* | |
* Licensed under the Confluent Community License (the "License"); you may not use | |
* this file except in compliance with the License. You may obtain a copy of the | |
* License at | |
* | |
* http://www.confluent.io/confluent-community-license | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Copyright 2018 Confluent Inc. | |
* | |
* Licensed under the Confluent Community License (the "License"); you may not use | |
* this file except in compliance with the License. You may obtain a copy of the | |
* License at | |
* | |
* http://www.confluent.io/confluent-community-license | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder