Category Archives: Program

[Hadoop]Java access HBase

編譯及執行方式請依照Hadoop編譯執行方式來操作

CreateTable(執行時需傳入tablename及至少一個的column family參數)

GetColumn(執行時傳入tablename、rowkey、family、column)

ScanColumn(執行時傳入tablename、family、column)

PutData(執行時傳入tablename、rowkey、family、column、value)

DropTable(執行時輸入tablename)

Continue Reading

[Hadoop]Hadoop及HBase程式編譯與執行

編譯:

若單純只是存取到HDFS,編譯時只需要用到hadoop的jar檔

存取HBase的程式則需要用到HBase的jar檔

(注意:若沒使用commons-cli-1.2.jar會出現cannot access org.apache.commons.cli.Options的錯誤)

封裝:

將class檔封裝成jar檔

將Test.class封裝成Test.jar

將MyJava資料夾封裝jar,注意最後有一個點,代表jar檔放到原路徑

執行:

(在Hadoop目錄底下)

Continue Reading

[Java]Sample Socket Server & Client

Server:

Client:

DataInputStream 和 DataOutputStream的用法 read(write) read(write)Boolean read(write)Byte read(write)Bytes read(write)Char read(write)Chars read(write)Double read(write)Float read(write)Int read(write)Long read(write)Short read(write)UTF

Continue Reading