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
// Demo of PostgreSQL to Java Three-Valued-Logic and conversion functions | |
// Paul Brebner, April 2021 | |
public enum TVL { | |
TRUE, | |
FALSE, | |
UNKNOWN; | |
// Note this function won't work with PreparedStatements only Statements | |
public String toPGBoolString() |
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
/* | |
* 3D Geohash modified from https://github.com/kungfoo/geohash-java/blob/master/src/main/java/ch/hsr/geohash/GeoHash.java | |
* Paul Brebner, Instaclustr.com | |
* 5 June 2019 | |
* Just a demonstration of how altitude can be used to encode a 3D geohash, for use with Anomalia Machina blog series. | |
*/ | |
import java.io.Serializable; | |
import java.util.HashMap; | |
import java.util.Map; |
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.concurrent.ThreadLocalRandom; | |
// Opentracing APIs | |
import io.opentracing.Tracer; | |
import io.opentracing.References; | |
import io.opentracing.Span; | |
import io.opentracing.SpanContext; | |
// Jaeger is a specific tracer | |
import io.jaegertracing.Configuration; |
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 spark1; | |
import scala.Tuple2; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.apache.spark.SparkConf; | |
import org.apache.spark.api.java.JavaPairRDD; | |
import org.apache.spark.api.java.JavaRDD; | |
import org.apache.spark.api.java.function.Function; | |
import org.apache.spark.mllib.evaluation.BinaryClassificationMetrics; |
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 test1; | |
import java.time.Instant; | |
import java.time.temporal.ChronoUnit; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import com.datastax.driver.core.*; | |
import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy; |
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
/* simple use case | |
* using new materialized view instametrics.host_service_value | |
* for all nodes find max and min and avg values of gc duration for each node and print out. | |
*/ | |
/* host names table | |
* CREATE TABLE instametrics.host ( | |
host text PRIMARY KEY | |
*/ | |
System.out.println("getting all node names"); |
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 test1; | |
import java.util.Date; | |
import com.datastax.driver.core.*; | |
import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy; | |
/* | |
* Simple Java client test to connect to trial cluster, create a time series data table, fill it, query it, and save it as csv for graphing. | |
*/ |