KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > nutch > ndfs > FSConstants


1 /* Copyright (c) 2004 The Nutch Organization. All rights reserved. */
2 /* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */
3 package net.nutch.ndfs;
4
5 /************************************
6  * Some handy constants
7  *
8  * @author Mike Cafarella
9  ************************************/

10 public interface FSConstants {
11     public static int BLOCK_SIZE = 32 * 1000 * 1000;
12     //public static int BLOCK_SIZE = 2173;
13

14     public static final long WRITE_COMPLETE = 0xcafae11a;
15
16     //
17
// IPC Opcodes
18
//
19
// Processed at namenode
20
public static final byte OP_ERROR = (byte) 0;
21     public static final byte OP_HEARTBEAT = (byte) 1;
22     public static final byte OP_BLOCKRECEIVED = (byte) 2;
23     public static final byte OP_BLOCKREPORT = (byte) 3;
24     public static final byte OP_TRANSFERDATA = (byte) 4;
25
26     // Processed at namenode, from client
27
public static final byte OP_CLIENT_OPEN = (byte) 20;
28     public static final byte OP_CLIENT_STARTFILE = (byte) 21;
29     public static final byte OP_CLIENT_ADDBLOCK = (byte) 22;
30     public static final byte OP_CLIENT_RENAMETO = (byte) 23;
31     public static final byte OP_CLIENT_DELETE = (byte) 24;
32     public static final byte OP_CLIENT_COMPLETEFILE = (byte) 25;
33     public static final byte OP_CLIENT_LISTING = (byte) 26;
34     public static final byte OP_CLIENT_OBTAINLOCK = (byte) 27;
35     public static final byte OP_CLIENT_RELEASELOCK = (byte) 28;
36     public static final byte OP_CLIENT_EXISTS = (byte) 29;
37     public static final byte OP_CLIENT_ISDIR = (byte) 30;
38     public static final byte OP_CLIENT_MKDIRS = (byte) 31;
39     public static final byte OP_CLIENT_RENEW_LEASE = (byte) 32;
40     public static final byte OP_CLIENT_ABANDONBLOCK = (byte) 33;
41     public static final byte OP_CLIENT_RAWSTATS = (byte) 34;
42     public static final byte OP_CLIENT_DATANODEREPORT = (byte) 35;
43     
44     // Processed at datanode, back from namenode
45
public static final byte OP_ACK = (byte) 40;
46     public static final byte OP_TRANSFERBLOCKS = (byte) 41;
47     public static final byte OP_INVALIDATE_BLOCKS = (byte) 42;
48     public static final byte OP_FAILURE = (byte) 43;
49
50     // Processed at client, back from namenode
51
public static final byte OP_CLIENT_OPEN_ACK = (byte) 60;
52     public static final byte OP_CLIENT_STARTFILE_ACK = (byte) 61;
53     public static final byte OP_CLIENT_ADDBLOCK_ACK = (byte) 62;
54     public static final byte OP_CLIENT_RENAMETO_ACK = (byte) 63;
55     public static final byte OP_CLIENT_DELETE_ACK = (byte) 64;
56     public static final byte OP_CLIENT_COMPLETEFILE_ACK = (byte) 65;
57     public static final byte OP_CLIENT_TRYAGAIN = (byte) 66;
58     public static final byte OP_CLIENT_LISTING_ACK = (byte) 67;
59     public static final byte OP_CLIENT_OBTAINLOCK_ACK = (byte) 68;
60     public static final byte OP_CLIENT_RELEASELOCK_ACK = (byte) 69;
61     public static final byte OP_CLIENT_EXISTS_ACK = (byte) 70;
62     public static final byte OP_CLIENT_ISDIR_ACK = (byte) 71;
63     public static final byte OP_CLIENT_MKDIRS_ACK = (byte) 72;
64     public static final byte OP_CLIENT_RENEW_LEASE_ACK = (byte) 73;
65     public static final byte OP_CLIENT_ABANDONBLOCK_ACK = (byte) 74;
66     public static final byte OP_CLIENT_RAWSTATS_ACK = (byte) 75;
67     public static final byte OP_CLIENT_DATANODEREPORT_ACK = (byte) 76;
68
69     // Processed at datanode stream-handler
70
public static final byte OP_WRITE_BLOCK = (byte) 80;
71     public static final byte OP_READ_BLOCK = (byte) 81;
72     public static final byte OP_READSKIP_BLOCK = (byte) 82;
73
74     // Encoding types
75
public static final byte RUNLENGTH_ENCODING = 0;
76     public static final byte CHUNKED_ENCODING = 1;
77
78     // Return codes for file create
79
public static final int OPERATION_FAILED = 0;
80     public static final int STILL_WAITING = 1;
81     public static final int COMPLETE_SUCCESS = 2;
82
83     //
84
// Timeouts, constants
85
//
86
public static long HEARTBEAT_INTERVAL = 3 * 1000;
87     public static long EXPIRE_INTERVAL = 4 * HEARTBEAT_INTERVAL;
88     public static long BLOCKREPORT_INTERVAL = 9 * 60 * 1000;
89     public static long OBSOLETE_INTERVAL = 10 * 60 * 1000;
90     public static long SYSTEM_STARTUP_PERIOD = 15 * 1000;
91     public static long DATANODE_STARTUP_PERIOD = 30 * 1000;
92     public static long LEASE_PERIOD = 16 * 1000;
93 }
94
Popular Tags