Review Board 1.7.22


ZOOKEEPER-1346: Handle 4lws and monitoring on separate port (creating jetty server)

Review Request #8094 - Created Nov. 16, 2012 and updated

Skye Wanderman-Milne
trunk
ZOOKEEPER-1346
Reviewers
zookeeper
HenryR, phunt, skamille
zookeeper-git
See my comment in ZOOKEEPER-1346.
unit tests

Ran in standalone mode (only option right now) and manually tried out all the commands/links

Diff revision 5 (Latest)

1 2 3 4 5
1 2 3 4 5

  1. src/java/main/org/apache/zookeeper/server/admin/Command.java: Loading...
  2. src/java/main/org/apache/zookeeper/server/admin/CommandBase.java: Loading...
  3. src/java/main/org/apache/zookeeper/server/admin/CommandOutputter.java: Loading...
  4. src/java/main/org/apache/zookeeper/server/admin/Commands.java: Loading...
  5. src/java/main/org/apache/zookeeper/server/admin/DummyAdminServer.java: Loading...
  6. src/java/main/org/apache/zookeeper/server/admin/JettyAdminServer.java: Loading...
  7. src/java/main/org/apache/zookeeper/server/admin/JsonOutputter.java: Loading...
  8. src/java/main/org/apache/zookeeper/server/quorum/Leader.java: Loading...
  9. src/java/main/org/apache/zookeeper/server/quorum/Learner.java: Loading...
  10. src/java/main/org/apache/zookeeper/server/quorum/LearnerSessionTracker.java: Loading...
  11. src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java: Loading...
  12. src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java: Loading...
  13. src/java/main/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java: Loading...
  14. src/java/test/org/apache/zookeeper/ZKTestCase.java: Loading...
  15. src/java/test/org/apache/zookeeper/server/PrepRequestProcessorTest.java: Loading...
  16. src/java/test/org/apache/zookeeper/server/admin/CommandsTest.java: Loading...
  17. src/java/test/org/apache/zookeeper/server/admin/JettyAdminServerTest.java: Loading...
  18. src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java: Loading...
  19. src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java: Loading...
  20. src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java: Loading...
This diff has been split across 2 pages: < 1 2
src/java/main/org/apache/zookeeper/server/admin/Command.java
New File

    
   
1
/**

    
   
2
 * Licensed to the Apache Software Foundation (ASF) under one

    
   
3
 * or more contributor license agreements.  See the NOTICE file

    
   
4
 * distributed with this work for additional information

    
   
5
 * regarding copyright ownership.  The ASF licenses this file

    
   
6
 * to you under the Apache License, Version 2.0 (the

    
   
7
 * "License"); you may not use this file except in compliance

    
   
8
 * with the License.  You may obtain a copy of the License at

    
   
9
 *

    
   
10
 *     http://www.apache.org/licenses/LICENSE-2.0

    
   
11
 *

    
   
12
 * Unless required by applicable law or agreed to in writing, software

    
   
13
 * distributed under the License is distributed on an "AS IS" BASIS,

    
   
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    
   
15
 * See the License for the specific language governing permissions and

    
   
16
 * limitations under the License.

    
   
17
 */

    
   
18

   

    
   
19
package org.apache.zookeeper.server.admin;

    
   
20

   

    
   
21
import java.util.Map;

    
   
22
import java.util.Set;

    
   
23

   

    
   
24
import org.apache.zookeeper.server.ZooKeeperServer;

    
   
25

   

    
   
26
/**

    
   
27
 * Interface implemented by all commands runnable by JettyAdminServer.

    
   
28
 *

    
   
29
 * @see CommandBase

    
   
30
 * @see Commands

    
   
31
 * @see JettyAdminServer

    
   
32
 */

    
   
33
public interface Command {

    
   
34
    /**

    
   
35
     * The set of all names that can be used to refer to this command (e.g.,

    
   
36
     * "configuration", "config", and "conf").

    
   
37
     */

    
   
38
    Set<String> getNames();

    
   
39

   

    
   
40
    /**

    
   
41
     * The name that is returned with the command response and that appears in

    
   
42
     * the list of all commands. This should be a member of the set returned by

    
   
43
     * getNames().

    
   
44
     */

    
   
45
    String getPrimaryName();

    
   
46

   

    
   
47
    /**

    
   
48
     * A string documentating this command (e.g., what it does, any arguments it

    
   
49
     * takes).

    
   
50
     */

    
   
51
    String getDoc();

    
   
52

   

    
   
53
    /**

    
   
54
     * Run this command. Commands take a ZooKeeperServer and String-valued

    
   
55
     * keyword arguments and return a map containing any information

    
   
56
     * constituting the response to the command. Commands are responsible for

    
   
57
     * parsing keyword arguments and performing any error handling if necessary.

    
   
58
     * Errors should be reported by setting the "error" entry of the returned

    
   
59
     * map with an appropriate message rather than throwing an exception.

    
   
60
     *

    
   
61
     * @param zkServer

    
   
62
     * @param kwargs keyword -> argument value mapping

    
   
63
     * @return Map representing response to command containing at minimum:

    
   
64
     *    - "command" key containing the command's primary name

    
   
65
     *    - "error" key containing a String error message or null if no error

    
   
66
     */

    
   
67
    Map<String, Object> run(ZooKeeperServer zkServer, Map<String, String> kwargs);

    
   
68
}
src/java/main/org/apache/zookeeper/server/admin/CommandBase.java
New File
 
src/java/main/org/apache/zookeeper/server/admin/CommandOutputter.java
New File
 
src/java/main/org/apache/zookeeper/server/admin/Commands.java
New File
 
src/java/main/org/apache/zookeeper/server/admin/DummyAdminServer.java
New File
 
src/java/main/org/apache/zookeeper/server/admin/JettyAdminServer.java
New File
 
src/java/main/org/apache/zookeeper/server/admin/JsonOutputter.java
New File
 
src/java/main/org/apache/zookeeper/server/quorum/Leader.java
Revision 87ebd7b New Change
 
src/java/main/org/apache/zookeeper/server/quorum/Learner.java
Revision e8d548b New Change
 
src/java/main/org/apache/zookeeper/server/quorum/LearnerSessionTracker.java
Revision 3182419 New Change
 
src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
Revision 9c17f5e New Change
 
src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java
Revision deae926 New Change
 
src/java/main/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java
Revision d3f1492 New Change
 
src/java/test/org/apache/zookeeper/ZKTestCase.java
Revision 6ecfe8f New Change
 
src/java/test/org/apache/zookeeper/server/PrepRequestProcessorTest.java
Revision 8665bac New Change
 
src/java/test/org/apache/zookeeper/server/admin/CommandsTest.java
New File
 
src/java/test/org/apache/zookeeper/server/admin/JettyAdminServerTest.java
New File
 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java
Revision 2707c26 New Change
 
src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java
Revision c39f4c9 New Change
 
src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java
Revision f107e04 New Change
 
  1. src/java/main/org/apache/zookeeper/server/admin/Command.java: Loading...
  2. src/java/main/org/apache/zookeeper/server/admin/CommandBase.java: Loading...
  3. src/java/main/org/apache/zookeeper/server/admin/CommandOutputter.java: Loading...
  4. src/java/main/org/apache/zookeeper/server/admin/Commands.java: Loading...
  5. src/java/main/org/apache/zookeeper/server/admin/DummyAdminServer.java: Loading...
  6. src/java/main/org/apache/zookeeper/server/admin/JettyAdminServer.java: Loading...
  7. src/java/main/org/apache/zookeeper/server/admin/JsonOutputter.java: Loading...
  8. src/java/main/org/apache/zookeeper/server/quorum/Leader.java: Loading...
  9. src/java/main/org/apache/zookeeper/server/quorum/Learner.java: Loading...
  10. src/java/main/org/apache/zookeeper/server/quorum/LearnerSessionTracker.java: Loading...
  11. src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java: Loading...
  12. src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java: Loading...
  13. src/java/main/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java: Loading...
  14. src/java/test/org/apache/zookeeper/ZKTestCase.java: Loading...
  15. src/java/test/org/apache/zookeeper/server/PrepRequestProcessorTest.java: Loading...
  16. src/java/test/org/apache/zookeeper/server/admin/CommandsTest.java: Loading...
  17. src/java/test/org/apache/zookeeper/server/admin/JettyAdminServerTest.java: Loading...
  18. src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java: Loading...
  19. src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java: Loading...
  20. src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java: Loading...
This diff has been split across 2 pages: < 1 2