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
function _M.encode_binary_length(len) | |
return (math.ceil(tonumber(len) / 7) * 8) + 1 | |
end | |
local encode_masks = { | |
{0x01, 0xfc}, | |
{0x03, 0xf8}, | |
{0x07, 0xf0}, | |
{0x0f, 0xe0}, | |
{0x1f, 0xc0}, | |
{0x3f, 0x80}, |
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
cockroach's stragegy: | |
rangeはsplitでしか増えない | |
splitの時、新しくできたrangeのreplicaは同じ(raftで元々のrangeのレプリカ全部に対してsplitが実行されるので、自然な挙動) | |
splitされたrangeはrebalanceされる | |
それ以外に、zone config(複数データセンターに配置する設定)に違反しているrangeがrebalanceされる | |
rebalanceの結果は全ノードにpropagateしないとリクエストをどこにroutingしていいかわからないのできついが、cockroachはどうするつもりか | |
=> | |
key - rangeの対応関係を保存するためのrangeが2段階あり、それは通常のrangeのように幾つかのレプリカに保存されている。 |
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
LD_PRELOAD="foo.so bar.so" baz |
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
-- contains all meta1 range data | |
root range | |
[ | |
meta1_0000 : {meta1_0000..meta1_1000, 1.1.1.1, 1.1.1.2, 1.1.1.3} | |
meta1_1001 : {meta1_1001..meta1_2000, 1.1.2.1, 1.1.2.2, 1.1.2.3} | |
... | |
meta1_N001 : {meta1_N001..meta1_(N+1)000, 1.1.N.1, 1.1.N.2, 1.1.N.3} | |
] |
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
### クラスタへの参加 | |
- おそらくノードが自律的に参加する | |
- 最初の接続先をどのように取得しているか、 | |
- gossipの仕組みとも関係あり。gossip自体の仕組みに接続先を探す能力がある? | |
### gossip protocol実装詳細 | |
- deltaの作成、マージ方法 | |
- おそらく一直線のバージョンではないので、レコードのキーとバージョンを見ているのではないか | |
### raft詳細 |
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
> ffi = require 'ffi' | |
> a = ffi.new('uint32_t') | |
> a | |
>> | |
>> print(a) | |
stdin:3: '=' expected near 'print' | |
> print(a) | |
cdata<unsigned int>: 0x0004c850 | |
> refl = require 'reflect' | |
> t = refl.typeof(a) |
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
okyougemusu-no-MacBook-Pro:lua-aws iyatomi$ luajit test/sqs.lua | |
requestto: http://sqs.ap-northeast-1.amazonaws.com:80/ | |
sentbody: AWSAccessKeyId=&Action=CreateQueue&QueueName=testQueue&Signature=kS87ine8I4Kqcj5U1OvqQ%2FB04DvWBmbGCmYxIZwlPq0%3D&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-10-15T10%3A14%3A10%2B0900&Version=2012-11-05 | |
result of query: 1 200 HTTP/1.1 200 OK | |
header: content-length 333 | |
header: x-amzn-requestid 9f0dc946-eaff-5c2e-8a6c-85f1265b917b | |
header: content-type text/xml | |
create header <?xml version="1.0"?> | |
create value table: 0x000ecbc8 | |
create.value CreateQueueResponse table: 0x000e91e0 |
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
docker run -ti --name gcloud-config google/cloud-sdk gcloud auth login |
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
sudo bash -c "GOPATH=/var/src/apiserver:/master-release/src/go/Godeps/_workspace/ go build -ldflags '-X github.com/GoogleCloudPlatform/kubernetes/pkg/version.gitCommit 431caa93dfdbe86e14c8041e64ba10bcc80a7b40 -X github.com/GoogleCloudPlatform/kubernetes/pkg/version.gitTreeState dirty -X github.com/GoogleCloudPlatform/kubernetes/pkg/version.gitVersion v0.3-111-g431caa93dfdbe8-dirty -X github.com/GoogleCloudPlatform/kubernetes/pkg/version.gitMajor 0 -X github.com/GoogleCloudPlatform/kubernetes/pkg/version.gitMinor 3+' github.com/GoogleCloudPlatform/kubernetes/cmd/apiserver" |
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
x.y.z.w - - [30/Sep/2014:08:54:31 +0000] "HEAD https://a.b.c.d/?062DC6CD=1516067840&2213C83C=12B46F18&34C120D0=21E47521&...snip...&26BC961A=1264512866 HTTP/1.1" 401 0 "-" "-" |