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
| CREATE TABLE "1004_ALERT_TYPE" | |
| ( | |
| NAME varchar(100) primary key, | |
| d.atd varchar(100), | |
| d.atn varchar(10) | |
| ) | |
| select * from "1004_ALERT_TYPE" limit 100 |
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 java.util.Properties; | |
| public class PrintSystemProperties{ | |
| public static void main(String[] args) { | |
| Properties prop = System.getProperties(); | |
| for( String name : prop.stringPropertyNames()) | |
| { |
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
| System.out.println("foo" == "foo"); | |
| System.out.println(new String("bar") == new String("bar")); | |
| System.out.println("bar" == new String("bar").intern()); | |
| String a = "12345"; | |
| String b = "12345"; | |
| System.out.println(a == b); | |
| System.out.println(a.equals(b)); |
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
| 1) mvn archetype:create -DgroupId=com.jmi.elasticsearch -DartifactId=ESearchSamples | |
| 2) Open pom.xml and add | |
| <dependency> | |
| <groupId>org.elasticsearch</groupId> | |
| <artifactId>elasticsearch</artifactId> | |
| <version>0.90.7</version> | |
| </dependency> |
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.hadoop.hbase.client.Scan | |
| import org.apache.hadoop.hbase.util.Bytes | |
| import org.apache.hadoop.hbase.client.HTable | |
| import org.apache.hadoop.hbase.HBaseConfiguration | |
| config = HBaseConfiguration.create() | |
| family = Bytes.toBytes("family-name") | |
| qual = Bytes.toBytes("qualifier") | |
| scan = Scan.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
| for i in *; do new_name=$(echo $i | sed -e 's/1012/1015/g'); sed -i 's/1012/1015/g' $i ; mv $i $new_name; done |
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
| scan '1012_HIERARCHY_TYPE',{FILTER=>"SingleColumnValueFilter('D','HTN',=,'binary:Country') AND TimestampsFilter(1391167399643)"} | |
| scan '1012_DEVICE_ENERGY', { FILTER =>"RowFilter(=,'substring:2/6')"} | |
| scan '1012_DEVICE_ENERGY', { FILTER =>"RowFilter(=,'regexstring:6')"} |
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 | |
| HBASE_REST_SERVER='http://hbase_rest_server:8080' | |
| ### Open customers file and read customer list | |
| while read line | |
| do | |
| IFS=', ' read -a array <<< $line | |
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
| while true; do | |
| # Waste time | |
| if [ $wasted_time -gt 100000 ]; then | |
| exit 0 | |
| fi | |
| done |
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
| ## declare an array variable | |
| declare -a arr=("element1" "element2" "element3") | |
| ## now loop through the above array | |
| for i in "${arr[@]}" | |
| do | |
| echo "$i" | |
| # or do whatever with individual element of the array | |
| done |