摘要:
1、MapReduce 运行流程 (1)、JobClient 调用 submitJob(),提交Job (2)、JobClient 向 JobTracker 请求一个新的JobId(调用 JobTracker.getNewJobId() ) (3)、JobClient检查作业的输出说明,计算作业的输 阅读全文
posted @ 2014-05-28 08:48
lihui1625
阅读(133)
评论(0)
推荐(0)
摘要:
《精通正则表达式》 第401页 public static ListsplitCSV(String txt) { String reg = "\\G(?:^|,)(?:\"([^\"]*+(?:\"\"[^\"]*+)*+)\"|([^\",]*+))"; // 即 ... 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(800)
评论(0)
推荐(0)
摘要:
1. 数据记录FileStatus public class FileStatus implements Writable { private String filename; private long time; static { // register IPCFileStatus Writabl 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(179)
评论(0)
推荐(0)
摘要:
1.数据记录FileStatus public class FileStatus { private String filename; private long time; public FileStatus(String filename) { this.filename=filename; th 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(98)
评论(0)
推荐(0)
摘要:
1. ClientCall的 wait() 和 notify() public class Client { public Writablecall(Writable param, ClientConnectionId remoteId) throwsInterruptedException, IO 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(114)
评论(0)
推荐(0)
摘要:
1. RPCClientCache 中的 clients publicclass RPCClientCache { private Map<SocketFactory,Client> clients = new HashMap<SocketFactory,Client>(); synchronize 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(201)
评论(0)
推荐(0)
摘要:
1.服务器端主要类 public abstractclass Server { public static final ByteBuffer HEADER =ByteBuffer.wrap("hrpc".getBytes()); public static final byte CURRENT_VE 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(107)
评论(0)
推荐(0)
摘要:
0 <= position <= limit <= capacity Buffer.clear(): 清空数据。limit = capacity,position = 0 Buffer.flip(): 调整指针供读写。limit = position,position = 0 Buffer.rewi 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(170)
评论(0)
推荐(0)
摘要:
1.发送请求:query.getCPUStatus("Intel"); 2.传送到:RPCInvoker.invoke(Object proxy, Method method, Object[]args) 其中method:publicabstract org.hadoopinternal.ipc. 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(98)
评论(0)
推荐(0)
摘要:
1. Java 默认序列化 public class Block1 implements Serializable { private static finallong serialVersionUID = 1276464248616673062L; privatelong blockId; pri 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(126)
评论(0)
推荐(0)
摘要:
1.客户端 公司产品的客户端的使用阻塞式的Socket,并没有使用NIO,在Hadoop中遇到再议。 2.服务器端 2.1 阻塞式 例子程序 public class BIOServer { static class Hanlder extendsThread { privateSocket soc 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(144)
评论(0)
推荐(0)
摘要:
1. 测试wordcount,其源码如下: public class WordCount { public static classTokenizerMapper extends Mapper{ ............ } } public static classIntSumReducer ex 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(123)
评论(0)
推荐(0)
摘要:
1、对共享的JAVA对象的访问可以通过将其方法声明为同步的而被串行化.当这种对象被复制时,这种方法足以保证访问的串行化吗? 答:不能.问题是对每一个复制对象的访问是串行化的.但是对不同的复制对象可以在同一时间进行不同的操作,使得复制的实例变量不一致. 2、对于第一章所讨论的监视器,如果允许在一个复制 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(832)
评论(0)
推荐(0)
摘要:
1、说出至少三种可在WWV广播时间和在分布式系统中处理机设置内部时钟之间引入的延迟源。 答:信号在大气中的传播延迟,当机器在协调WWV接受者与以太网时的碰撞延迟,包在局域网上的传播延迟,各个处理器由于中断处理延迟和内部队列延迟所产生的延迟。 2、考虑分布式系统中的两台机器的行为。这两台机器的时钟假设 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(1049)
评论(0)
推荐(0)
摘要:
1. Q: Give an example of where an address of an entity Eneeds to be further resolved into another address to actuallyaccess E. A: IP addresses in the 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(392)
评论(0)
推荐(0)
摘要:
1.数据节点储存 org.apache.hadoop.hdfs.server.datanode.DataStorage public class DataStorage extends Storage { // Constants final static String BLOCK_SUBDIR_P 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(363)
评论(0)
推荐(0)
摘要:
1. 客户端与NameNode接口 org.apache.hadoop.hdfs.protocol.ClientProtocol public interface ClientProtocol extends VersionedProtocol { public int GET_STATS_CAPA 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(195)
评论(0)
推荐(0)
摘要:
1. Hadoop 抽象文件系统 org.apache.hadoop.fs.FileSystem,具体HDFS是这个抽象类的子类 publicabstractclassFileSystemextendsConfiguredimplementsCloseable{ publicstaticfinalS 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(432)
评论(0)
推荐(0)
摘要:
待续 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(76)
评论(0)
推荐(0)
摘要:
待续 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(89)
评论(0)
推荐(0)
摘要:
两个连接请求发出后,生成ClientConnectionId对象,只要两个ClientConnectionId对象的hashcode相同,就视为一个同一个连接,从而复用ClientConnection publicRPCInvoker(Class《?extendsVersionedProtocol》 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(106)
评论(0)
推荐(0)
摘要:
两个连接请求发出后,生成ClientConnectionId对象,只要两个ClientConnectionId对象的hashcode相同,就视为一个同一个连接,从而复用ClientConnection publicRPCInvoker(Class《?extendsVersionedProtocol》 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(230)
评论(0)
推荐(0)
摘要:
1.SelectionKey.OP_ACCEPT publicclassServerListenerextendsThread{ publicServerListener(Serverserver) throwsIOException{ this.server=server; address=new 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(144)
评论(0)
推荐(0)
摘要:
1.SelectionKey.OP_ACCEPT publicclassServerListenerextendsThread{ publicServerListener(Serverserver) throwsIOException{ this.server=server; address=new 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(120)
评论(0)
推荐(0)
摘要:
1.Server的wait、notify public abstractclass Server { public synchronized void join()throws InterruptedException { while (running){ wait(); } } public sy 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(120)
评论(0)
推荐(0)
摘要:
1.Server的 callQueue 典型的生产者-消费者模式 public abstractclass Server { BlockingQueue<ServerCall> callQueue; } publicclass ServerConnection { privatevoid proce 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(120)
评论(0)
推荐(0)
摘要:
1.Server 的 running public abstract class Server { volatile boolean running =true; // true while server runs publicsynchronized void join() throwsInter 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(92)
评论(0)
推荐(0)
摘要:
1.Class类的running 用于主线程的Client 和若干 ClientConnection 线程之间 共享Client的running变量 public classClient { public AtomicBoolean running = newAtomicBoolean(true); 阅读全文
posted @ 2014-05-28 08:47
lihui1625
阅读(149)
评论(0)
推荐(0)
摘要:
http://www.blogjava.net/watchzerg/archive/2012/09/22/388346.html mongoDB java驱动学习笔记 指定新mongo实例: Mongo m = new Mongo(); Mongo m = new Mongo( "localhost 阅读全文
posted @ 2014-05-28 08:46
lihui1625
阅读(147)
评论(0)
推荐(0)
摘要:
原文地址:Apache+Tomcat负载均衡两种session共享方式的设置作者:梦回两千载 session共享有两种方式: 1、session共享,多个服务器session拷贝保存,一台宕机不会影响用户的登录状态; 2、请求精确集中定位,即当前用户的请求都集中定位到一台服务器中,这样单台服务器保存 阅读全文
posted @ 2014-05-28 08:46
lihui1625
阅读(245)
评论(0)
推荐(0)
浙公网安备 33010602011771号