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 | |
| numberOfEvents=$1 | |
| fluentdUrl=$2 | |
| USAGE="send-events-to-fluentd.sh numberOfEvents fluentdUrl" | |
| if [[ $# -ne 2 ]]; then | |
| echo $USAGE | |
| exit 1 | |
| fi |
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
| config.vm.provision "shell", path: "provision.sh" |
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
| - name: Install Elasticsearch | |
| hosts: rails.myvm | |
| sudo: true | |
| vars: | |
| elasticsearch_install_java: true | |
| elasticsearch_timezone: Asia/Tokyo | |
| elasticsearch_plugins: | |
| - name: 'transport-couchbase' | |
| url: 'http://packages.couchbase.com.s3.amazonaws.com/releases/elastic-search-adapter/1.2.0/elasticsearch-transport-couchbase-1.2.0.zip' | |
| - name: 'mobz/elasticsearch-head' |
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
| Running local couchbase lite instance | |
| username: d4b724ee-131b-468e-b3ab-953d6fef2686 | |
| password: fcd11474-53db-44f8-b865-91d3fefe1779 | |
| http://d4b724ee-131b-468e-b3ab-953d6fef2686:fcd11474-53db-44f8-b865-91d3fefe1779@localhost:5984 | |
| Press Ctrl-C to shutdown | |
| [Fri Apr 24 06:10:23 JST 2015] TJWS httpd 0.0.0.0 - SimpleAcceptor ServerSocket[addr=0.0.0.0/0.0.0.0,localport=5984] is listening. | |
| 2015-04-24 06:14:41 | |
| Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode): |
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
| /* | |
| # =================== | |
| # How to execute | |
| # =================== | |
| # Install dependencies. | |
| $ npm install plotly | |
| $ npm install request | |
| $ npm install moment | |
| # Execute. | |
| $ node sync-streaming.js |
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
| String query = "SELECT airportname FROM `" + bucket.name() | |
| + "` WHERE type = 'airport' ORDER BY airportname ASC"; |
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
| N1qlQueryResult result = bucket.query(N1qlQuery.simple(query)); | |
| List<String> airports = new ArrayList<>(); | |
| for(N1qlQueryRow row : result){ | |
| airports.add(row.value().getString("airportname")); | |
| } | |
| return airports; |
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
| SimpleQuery query = Query.simple( | |
| select("airportname").from(i(bucket.name())).where( | |
| x("type").eq(s("airport")) | |
| .and(x("airportname").like(s(prefix + "%"))) | |
| ).orderBy(asc(x("airportname"))) | |
| ); | |
| logger.info(query.statement()); | |
| QueryResult result = bucket.query(query); | |
| List<String> airports = new ArrayList<>(); |
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 static com.couchbase.client.java.query.Select.select; | |
| import static com.couchbase.client.java.query.dsl.Expression.i; | |
| import static com.couchbase.client.java.query.dsl.Expression.s; | |
| import static com.couchbase.client.java.query.dsl.Expression.x; | |
| import static com.couchbase.client.java.query.dsl.Sort.asc; |
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 org.apache.commons.logging.Log; | |
| import org.apache.commons.logging.LogFactory; | |
| public class AirportController { | |
| private final Bucket bucket; | |
| private final Log logger = LogFactory.getLog(getClass()); | |
| public List<String> airportNamesStartingWith(@RequestParam String prefix) { | |
| N1qlQuery query = ...; | |
| logger.trace(query.statement()); |
OlderNewer