上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页
摘要: JobTracker无任务时处理心跳流程 HeartBeat格式:{restarted=true,initialContact=true,acceptNewTasks=true,responseId=-1, status=TaskTrackerStatus {failures=0,trackerNa 阅读全文
posted @ 2014-05-28 08:48 lihui1625 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 《精通正则表达式》 第401页 public static ListsplitCSV(String txt) { String reg = "\\G(?:^|,)(?:\"([^\"]*+(?:\"\"[^\"]*+)*+)\"|([^\",]*+))"; // 即 ... 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(787) 评论(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 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 两个连接请求发出后,生成ClientConnectionId对象,只要两个ClientConnectionId对象的hashcode相同,就视为一个同一个连接,从而复用ClientConnection publicRPCInvoker(Class《?extendsVersionedProtocol》 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 两个连接请求发出后,生成ClientConnectionId对象,只要两个ClientConnectionId对象的hashcode相同,就视为一个同一个连接,从而复用ClientConnection publicRPCInvoker(Class《?extendsVersionedProtocol》 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1.SelectionKey.OP_ACCEPT publicclassServerListenerextendsThread{ publicServerListener(Serverserver) throwsIOException{ this.server=server; address=new 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1. Hadoop 抽象文件系统 org.apache.hadoop.fs.FileSystem,具体HDFS是这个抽象类的子类 publicabstractclassFileSystemextendsConfiguredimplementsCloseable{ publicstaticfinalS 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 1.SelectionKey.OP_ACCEPT publicclassServerListenerextendsThread{ publicServerListener(Serverserver) throwsIOException{ this.server=server; address=new 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(114) 评论(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 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 待续 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 1.Server的 callQueue 典型的生产者-消费者模式 public abstractclass Server { BlockingQueue<ServerCall> callQueue; } publicclass ServerConnection { privatevoid proce 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(110) 评论(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 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 1.Class类的running 用于主线程的Client 和若干 ClientConnection 线程之间 共享Client的running变量 public classClient { public AtomicBoolean running = newAtomicBoolean(true); 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(136) 评论(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 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 待续 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(78) 评论(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 阅读(349) 评论(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 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1. ClientCall的 wait() 和 notify() public class Client { public Writablecall(Writable param, ClientConnectionId remoteId) throwsInterruptedException, IO 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1. RPCClientCache 中的 clients publicclass RPCClientCache { private Map<SocketFactory,Client> clients = new HashMap<SocketFactory,Client>(); synchronize 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(178) 评论(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 阅读(99) 评论(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 阅读(159) 评论(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 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 1. Java 默认序列化 public class Block1 implements Serializable { private static finallong serialVersionUID = 1276464248616673062L; privatelong blockId; pri 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(111) 评论(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 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1. 测试wordcount,其源码如下: public class WordCount { public static classTokenizerMapper extends Mapper{ ............ } } public static classIntSumReducer ex 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1、对共享的JAVA对象的访问可以通过将其方法声明为同步的而被串行化.当这种对象被复制时,这种方法足以保证访问的串行化吗? 答:不能.问题是对每一个复制对象的访问是串行化的.但是对不同的复制对象可以在同一时间进行不同的操作,使得复制的实例变量不一致. 2、对于第一章所讨论的监视器,如果允许在一个复制 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(732) 评论(0) 推荐(0) 编辑
摘要: 1、说出至少三种可在WWV广播时间和在分布式系统中处理机设置内部时钟之间引入的延迟源。 答:信号在大气中的传播延迟,当机器在协调WWV接受者与以太网时的碰撞延迟,包在局域网上的传播延迟,各个处理器由于中断处理延迟和内部队列延迟所产生的延迟。 2、考虑分布式系统中的两台机器的行为。这两台机器的时钟假设 阅读全文
posted @ 2014-05-28 08:47 lihui1625 阅读(936) 评论(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 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 1.比较使用单线程文件服务器读取文件和使用多线程服务器读取文件有什么不同。花费15ms来接收请求、调度该请求并且完成其它必须的处理工作,假定需要的数据存放在主存储器的缓存中。如果需要磁盘操作,就需要额外多花75ms在磁盘操作的过程中线程处于睡眠状态。如果服务器采用单线程的话,它每秒能处理多少个请求? 阅读全文
posted @ 2014-05-28 08:46 lihui1625 阅读(1072) 评论(0) 推荐(0) 编辑
摘要: 1、在许多分层协议中,每一层都有自己的报头。如果每个消息前部都只有单个报头,其中包含了所有控制信息,无疑会比使用单独的多个报头具有更高的效率。为什么不这么做? 答:协议的每一层都必须和其它层相独立。从第k+1层传送至第k层的数据同时包含了报头和数据,但是第k层协议不能对它们进行辨别。如果使用单个大的 阅读全文
posted @ 2014-05-28 08:46 lihui1625 阅读(564) 评论(0) 推荐(1) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页