Pacific-Design.com

    
Home Index

1. Cassandra

2. Create Partitions

Cassandra / Create Partitions /

Create 16 partitons (0-f) from any type of data


$ key='kevin'
$ echo -n $key | sha1sum | awk '{print $1}' | tail -c 2

9

Create 256 partitons (00-ff) from any type of data


$ key='kevin'
$ echo -n $key | sha1sum | awk '{print $1}' | tail -c 3

a9

Create 4096 partitons (000-fff) from any type of data


$ key='kevin'
$ echo -n $key | sha1sum | awk '{print $1}' | tail -c 4

aa9

Hashing Data with SHA1


$ key='kevin'
$ echo -n $key | sha1sum

ffb4761cba839470133bee36aeb139f58d7dbaa9  -