This file contains hidden or 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
// configuration and Serde creation left out for clarity | |
KStream<String, String> dataByAirportStream = builder.stream("raw-airline-data"); | |
GlobalKTable<String, byte[]> regressionsByAirPortTable = builder.globalTable(Serdes.String(), | |
byteArraySerde, | |
"onlineRegression-by-airport"); | |
// stream reads raw data joins with coefficients then makes prediction | |
dataByAirportStream.join(regressionsByAirPortTable, | |
(k, v) -> k, | |
DataRegression::new) |
This file contains hidden or 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
dataByAirportStream.join(regressionsByAirPortTable,(k, v) -> k, DataRegression::new) | |
.mapValues(Predictor::predict) | |
.filter((k, v) -> v != null) | |
.peek((k, v) -> System.out.println("Prediction " + v)) | |
.to("predictions"); |
This file contains hidden or 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
#!/bin/sh | |
KAFKA_DIR=/usr/local/kafka_2.11-0.9.0.0-SNAPSHOT | |
START_ZK="./bin/zookeeper-server-start.sh" | |
ZK_PROPS="config/zookeeper.properties" | |
START_KAFKA="./bin/kafka-server-start.sh" | |
KAFKA_PROPS="config/server.properties" |
This file contains hidden or 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 bbejeck.grouping | |
import org.apache.log4j.{Level, Logger} | |
import org.apache.spark.{SparkConf, SparkContext} | |
import scala.collection.mutable | |
/** | |
* Created by bbejeck on 8/6/15. | |
* Example usage of combineByKey |
This file contains hidden or 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 bbejeck.grouping | |
import org.apache.log4j.{Level, Logger} | |
import org.apache.spark.{SparkConf, SparkContext} | |
import scala.collection.mutable | |
/** | |
* Created by bbejeck on 7/31/15. | |
* |
This file contains hidden or 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 bbejeck.function; | |
import org.junit.Test; | |
import java.util.function.BinaryOperator; | |
import java.util.function.Function; | |
import static org.junit.Assert.*; | |
import static org.hamcrest.CoreMatchers.*; |
This file contains hidden or 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 2015 Bill Bejeck | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |
This file contains hidden or 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 bbejeck.guava.futures.SearchingTestBase; | |
import bbejeck.support.model.Person; | |
import com.google.common.base.Function; | |
import com.google.common.util.concurrent.*; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
import java.lang.SuppressWarnings; | |
import java.util.List; |
This file contains hidden or 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
#! /bin/sh | |
BLOG=blog_backup | |
BASE_DIR=/home/<username>/webapps/wp | |
USER=remote_username | |
PASS=database_password | |
DBUSER=database_user | |
DATABASE=database_name | |
DEST_DIR=destination_dir | |
IP_ADDRESS=blog_ip_address |
This file contains hidden or 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 com.google.common.util.concurrent.*; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.Executors; |