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
// Set up Handlers for Ping | |
public class PingHandler extends AbstractHttpHandler { | |
@Path("/ping") | |
@GET | |
public void handleThePing(HttpRequest request, HttpResponder responder){ | |
responder.sendString(HttpResponseStatus.OK, "OK"); | |
} | |
} | |
// Setup HTTP service and add Handlers |
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
// Set up Handlers for Ping | |
public class PingHandler extends AbstractHttpHandler { | |
@Path("/ping") | |
@GET | |
public void handleThePing(HttpRequest request, HttpResponder responder){ | |
responder.sendString(HttpResponseStatus.OK, "OK"); | |
} | |
} | |
// Setup HTTP service and add Handlers |
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
// BodyConsumer abstract-class is used to handle large files, | |
// we can handle the chunks as we receive it | |
// and handle clean up when we are done in the finished methodi | |
@Path("/upload") | |
@PUT | |
public BodyConsumer streamUploadFile(HttpRequest request, HttpResponder responder) throws FileNotFoundException { | |
final File file = new File(request.getHeader("File-Path")); | |
final FileChannel fileChannel = new FileOutputStream(file).getChannel(); | |
return new BodyConsumer() { |
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
NettyHttpService service = NettyHttpService.builder() | |
.setPort(7777) | |
.addHttpHandlers(ImmutableList.of(new UserInfoHandler(), new StatusHandler())) | |
.build(); |
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 AppFabricRestHandler extends NettyRestHandler { | |
.... | |
@Override | |
public void messageReceived(ChannelHandlerContext context, MessageEvent message) throws Exception { | |
HttpRequest request = (HttpRequest) message.getMessage(); | |
HttpMethod method = request.getMethod(); | |
String requestUri = request.getUri(); | |
QueryStringDecoder decoder = new QueryStringDecoder(request.getUri()); | |
String path = decoder.getPath(); |
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
curl -w"\n" -X POST "<hostname>:10000/v3/namespaces/default/artifacts/mysql-connector-java" \ | |
-H "Artifact-Plugins: [ { 'name': 'mysql', 'type': 'jdbc', 'className': 'com.mysql.jdbc.Driver' } ]" \ | |
-H "Artifact-Version: 5.1.38" \ | |
-H "Artifact-Extends: system:cdap-etl-batch[3.4.0, 4.0.0]/system:cdap-data-pipeline[3.4.1, 4.0.0]" \ | |
--data-binary @mysql-connector-java-5.1.38.jar |
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
#!/bin/bash | |
BASE_DIR="/Users/sree/Downloads/geofencing_module" | |
MICROSERVICE_JAR="/Users/sree/work/microservice/microservice-app/target/microservice-app-1.0.jar" | |
FENCE_DETECTION_MICROSERVICE_JAR="${BASE_DIR}/fence-detection-microservice/target/fence-detection-microservice-1.0-SNAPSHOT.jar" | |
FENCE_MANAGEMENT_APP_JAR="${BASE_DIR}/fence-management/target/fence-management-1.0-SNAPSHOT.jar" | |
FENCE_DETECTION_JSON_FILE="${BASE_DIR}/conf/microservice-fence-detector.json" | |
curl -v -X POST http://localhost:11015/v3/namespaces/default/artifacts/microservice-app --data-binary @"${MICROSERVICE_JAR}" |
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
# Dataproc initialization scripts for HBase, CDAP. | |
* To run: spin up a dataproc cluster with the following initialization actions | |
gs://dataproc-initialization-actions/zookeeper/zookeeper.sh (only if non-HA) | |
gs://cask-dataproc-initialization-actions/hbase.sh | |
gs://cask-dataproc-initialization-actions/cdap.sh (pulls cdap config from gh branch) |