Created
February 29, 2016 23:15
-
-
Save WilliamBerryiii/0b998619142f71efa92f to your computer and use it in GitHub Desktop.
Sample HBase Data Writer
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
let writeData (client:Hbase.Client) tableName dataColumn data = | |
let writePrams = new Dictionary<byte[],byte[]>() | |
let mutation = Collection.init [new Mutation ( Column = getBytes dataColumn, Value = getBytes data.Payload ) ] : List<Mutation> | |
let returnIdKeyedRow = new BatchMutation( Row = getBytes data.CompositeKey, Mutations = mutation ) | |
let deptClassSubKeyedRow = new BatchMutation( Row = getBytes data.ReverseCompositeKey, Mutations = mutation ) | |
let rows : List<BatchMutation> = Collection.init [returnIdKeyedRow; deptClassSubKeyedRow] | |
let result = client.mutateRows(getBytes tableName, rows, writePrams) | |
result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment