Skip to content

Instantly share code, notes, and snippets.

View shijinkui's full-sized avatar

JK shijinkui

View GitHub Profile
@shijinkui
shijinkui / gist:7450396
Created November 13, 2013 14:56
ringbuffer,entry中是ConcurrentLinkedQueue<LogEntry>, 用于缓存scribelog,满了就批量发出去
package com.twitter.common.logging;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
/**
* ringbuffer
* <pre>
* tail
@shijinkui
shijinkui / gist:7226043
Last active December 26, 2015 22:49
shark+spark+hive 安装

安装文档:https://github.com/amplab/shark/wiki/_pages

0.8 遇到的问题:

  1. mysql驱动

hive> show tables;
FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Error creating transactional connection factory
http://aosabook.org/en/index.html
@shijinkui
shijinkui / gist:6128293
Created August 1, 2013 03:55
zookeeper.java 代码阅读
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@shijinkui
shijinkui / akka pi demo
Last active June 11, 2017 21:15
akka worker demo Pi.java
/**
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
*/
package com.sohu.smc.worker;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.actor.UntypedActor;
@shijinkui
shijinkui / gist:6078727
Created July 25, 2013 11:06
zookeeper watcher event
WatchedEvent state:SyncConnected type:NodeDeleted path:/sohu-scm/smc-api/127.0.0.1/deploy_test
WatchedEvent state:SyncConnected type:NodeChildrenChanged path:/sohu-scm/smc-api/127.0.0.1
WatchedEvent state:SyncConnected type:NodeDeleted path:/sohu-scm/smc-api/127.0.0.1
WatchedEvent state:SyncConnected type:NodeChildrenChanged path:/sohu-scm/smc-api
WatchedEvent state:SyncConnected type:NodeCreated path:/sohu-scm/smc-api/127.0.0.1
WatchedEvent state:SyncConnected type:NodeCreated path:/sohu-scm/smc-api/127.0.0.1
WatchedEvent state:SyncConnected type:NodeChildrenChanged path:/sohu-scm/smc-api
WatchedEvent state:SyncConnected type:NodeCreated path:/sohu-scm/smc-api/127.0.0.1/deploy_test
@shijinkui
shijinkui / gist:5982585
Created July 12, 2013 07:30
git tag push
git tag -a v1.2 -m '1.2 tag'
git push --tags
git tag -l
@shijinkui
shijinkui / gist:5908009
Last active December 19, 2015 05:59
1500铁杆粉丝的实现

#1500铁杆粉丝的实现

凯文凯利在《技术元素》中有篇文章介绍1500铁杆粉丝理论,这里说说实现。

粉丝

  1. 粉丝分类:金、银、铜、铁、木、水、僵尸粉丝,每一类都是一个关注的范围值。如:金粉:2000+, 银粉:800~1200

  2. 动作分值

  3. 每个动作分值: 加关注(+1), 转发

@shijinkui
shijinkui / gist:5865645
Created June 26, 2013 08:11
2W汉字拼音
$pinyintable = array();
$pinyintable['丂'] = 'kao';
$pinyintable['丄'] = 'shang';
$pinyintable['丅'] = 'xia';
$pinyintable['丆'] = 'mo';
$pinyintable['丏'] = 'mian';
$pinyintable['丒'] = 'chou';
$pinyintable['丗'] = 'shi';
$pinyintable['丟'] = 'diu';
$pinyintable['丠'] = 'qiu';
@shijinkui
shijinkui / gist:5864445
Last active December 18, 2015 23:49
zipkin install
  1. 编译zipkin 需要修改私服地址,maven.twittr.com太慢,可以用

  2. project.scala 上传jar到私服 publishTo <<= version { v: String => val nexus = "http://aaaa.com/nexus/content/repositories/" if (v.trim.endsWith("SNAPSHOT")) Some("dp-nexus-snapshots" at nexus + "snapshots") else