hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r987314 [8/16] - in /hadoop/zookeeper/trunk: ./ src/contrib/hedwig/ src/contrib/hedwig/client/ src/contrib/hedwig/client/src/ src/contrib/hedwig/client/src/main/ src/contrib/hedwig/client/src/main/cpp/ src/contrib/hedwig/client/src/main/cpp...
Date Thu, 19 Aug 2010 21:25:22 GMT
Added: hadoop/zookeeper/trunk/src/contrib/hedwig/formatter.xml
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/formatter.xml?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/formatter.xml (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/formatter.xml Thu Aug 19 21:25:13 2010
@@ -0,0 +1,286 @@
+<!--
+   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
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="11">
+<profile kind="CodeFormatterProfile" name="Hedwig" version="11">
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+</profile>
+</profiles>

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/pom.xml?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/pom.xml (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/pom.xml Thu Aug 19 21:25:13 2010
@@ -0,0 +1,68 @@
+<!--
+   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
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.hedwig</groupId>
+  <version>1.0-SNAPSHOT</version>
+  <artifactId>hedwig</artifactId>
+  <packaging>pom</packaging>
+  <name>hedwig</name>
+  <modules>
+    <module>client</module>
+    <module>server</module>
+    <module>protocol</module>
+  </modules>
+  <repositories>
+  </repositories>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jxr-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <version>2.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <version>2.3</version>
+        <configuration>
+          <linkXref>true</linkXref>
+          <targetJdk>1.6</targetJdk>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+</project>

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/Makefile
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/Makefile?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/Makefile (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/Makefile Thu Aug 19 21:25:13 2010
@@ -0,0 +1,26 @@
+TARGET_DIR = target/generated-sources/cpp
+PROTO_DIR = src/main/protobuf
+
+INCLUDES = -I$(TARGET_DIR) 
+
+CXX = g++
+CXXFLAGS = -g $(INCLUDES)
+
+#-----File Dependencies----------------------
+PROTO = PubSubProtocol.proto
+SRC = $(TARGET_DIR)/$/$(PROTO_DIR)/$(addsuffix .pb.cc, $(basename $(PROTO)))
+OBJ = $(addsuffix .o, $(basename $(SRC)))
+
+all: $(OBJ)
+
+$(SRC):
+	mkdir -p $(TARGET_DIR); protoc --cpp_out=$(TARGET_DIR) $(PROTO_DIR)/$(PROTO)
+
+$(OBJ): $(SRC)
+	$(CXX) $(CXXFLAGS) -c $< -o $(OBJ)
+
+
+clean:
+	rm -rf $(TARGET_DIR)
+
+

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/pom.xml?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/pom.xml (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/pom.xml Thu Aug 19 21:25:13 2010
@@ -0,0 +1,77 @@
+<!--
+   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
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.hedwig</groupId>
+    <artifactId>hedwig</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.hedwig</groupId>
+  <artifactId>protocol</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>protocol</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <version>2.3.0</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <repositories>
+  </repositories>
+  <build>
+    <defaultGoal>install</defaultGoal>
+    <plugins>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>generate-sources</id>
+            <phase>generate-sources</phase>
+            <configuration>
+              <tasks>
+                <mkdir dir="target/generated-sources/java" />
+                <mkdir dir="target/generated-sources/cpp" />
+                <exec executable="protoc" failonerror="true">
+                  <arg value="--java_out=target/generated-sources/java" />
+                  <arg value="--cpp_out=target/generated-sources/cpp" />
+                  <arg value="src/main/protobuf/PubSubProtocol.proto" />
+                </exec>
+              </tasks>
+              <sourceRoot>target/generated-sources/java</sourceRoot>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/exceptions/PubSubException.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/exceptions/PubSubException.java?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/exceptions/PubSubException.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/exceptions/PubSubException.java Thu Aug 19 21:25:13 2010
@@ -0,0 +1,162 @@
+/**
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hedwig.exceptions;
+
+import java.util.Collection;
+
+import org.apache.hedwig.protocol.PubSubProtocol.StatusCode;
+
+@SuppressWarnings("serial")
+public abstract class PubSubException extends Exception {
+    protected StatusCode code;
+
+    protected PubSubException(StatusCode code, String msg) {
+        super(msg);
+        this.code = code;
+    }
+
+    protected PubSubException(StatusCode code, Exception e) {
+        super(e);
+        this.code = code;
+    }
+
+    public static PubSubException create(StatusCode code, String msg) {
+        if (code == StatusCode.CLIENT_ALREADY_SUBSCRIBED) {
+            return new ClientAlreadySubscribedException(msg);
+        } else if (code == StatusCode.CLIENT_NOT_SUBSCRIBED) {
+            return new ClientNotSubscribedException(msg);
+        } else if (code == StatusCode.MALFORMED_REQUEST) {
+            return new MalformedRequestException(msg);
+        } else if (code == StatusCode.NO_SUCH_TOPIC) {
+            return new NoSuchTopicException(msg);
+        } else if (code == StatusCode.NOT_RESPONSIBLE_FOR_TOPIC) {
+            return new ServerNotResponsibleForTopicException(msg);
+        } else if (code == StatusCode.SERVICE_DOWN) {
+            return new ServiceDownException(msg);
+        } else if (code == StatusCode.COULD_NOT_CONNECT) {
+            return new CouldNotConnectException(msg);
+        }
+        /*
+         * Insert new ones here
+         */
+        else if (code == StatusCode.UNCERTAIN_STATE) {
+            return new UncertainStateException(msg);
+        }
+        // Finally the catch all exception (for unexpected error conditions)
+        else {
+            return new UnexpectedConditionException("Unknow status code:" + code.getNumber() + ", msg: " + msg);
+        }
+    }
+
+    public StatusCode getCode() {
+        return code;
+    }
+
+    public static class ClientAlreadySubscribedException extends PubSubException {
+        public ClientAlreadySubscribedException(String msg) {
+            super(StatusCode.CLIENT_ALREADY_SUBSCRIBED, msg);
+        }
+    }
+
+    public static class ClientNotSubscribedException extends PubSubException {
+        public ClientNotSubscribedException(String msg) {
+            super(StatusCode.CLIENT_NOT_SUBSCRIBED, msg);
+        }
+    }
+
+    public static class MalformedRequestException extends PubSubException {
+        public MalformedRequestException(String msg) {
+            super(StatusCode.MALFORMED_REQUEST, msg);
+        }
+    }
+
+    public static class NoSuchTopicException extends PubSubException {
+        public NoSuchTopicException(String msg) {
+            super(StatusCode.NO_SUCH_TOPIC, msg);
+        }
+    }
+
+    public static class ServerNotResponsibleForTopicException extends PubSubException {
+        // Note the exception message serves as the name of the responsible host
+        public ServerNotResponsibleForTopicException(String responsibleHost) {
+            super(StatusCode.NOT_RESPONSIBLE_FOR_TOPIC, responsibleHost);
+        }
+    }
+
+    public static class TopicBusyException extends PubSubException {
+        public TopicBusyException(String msg) {
+            super(StatusCode.TOPIC_BUSY, msg);
+        }
+    }
+
+    public static class ServiceDownException extends PubSubException {
+        public ServiceDownException(String msg) {
+            super(StatusCode.SERVICE_DOWN, msg);
+        }
+
+        public ServiceDownException(Exception e) {
+            super(StatusCode.SERVICE_DOWN, e);
+        }
+    }
+
+    public static class CouldNotConnectException extends PubSubException {
+        public CouldNotConnectException(String msg) {
+            super(StatusCode.COULD_NOT_CONNECT, msg);
+        }
+    }
+
+    /*
+     * Insert new ones here
+     */
+    public static class UncertainStateException extends PubSubException {
+        public UncertainStateException(String msg) {
+            super(StatusCode.UNCERTAIN_STATE, msg);
+        }
+    }
+
+    // The catch all exception (for unexpected error conditions)
+    public static class UnexpectedConditionException extends PubSubException {
+        public UnexpectedConditionException(String msg) {
+            super(StatusCode.UNEXPECTED_CONDITION, msg);
+        }
+    }
+    
+    // The composite exception (for concurrent operations).
+    public static class CompositeException extends PubSubException {
+        private final Collection<PubSubException> exceptions;
+        public CompositeException(Collection<PubSubException> exceptions) {
+            super(StatusCode.COMPOSITE, "composite exception");
+            this.exceptions = exceptions;
+        }
+        public Collection<PubSubException> getExceptions() {
+            return exceptions;
+        }
+        @Override
+        public String toString() {
+            StringBuilder builder = new StringBuilder();
+            builder.append(super.toString()).append('\n');
+            for (PubSubException exception : exceptions)
+                builder.append(exception).append('\n');
+            return builder.toString();
+        }
+    }
+
+    public static class ClientNotSubscribedRuntimeException extends RuntimeException {
+    }
+
+}

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/MessageIdUtils.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/MessageIdUtils.java?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/MessageIdUtils.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/MessageIdUtils.java Thu Aug 19 21:25:13 2010
@@ -0,0 +1,153 @@
+/**
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hedwig.protoextensions;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.google.protobuf.ByteString;
+import org.apache.hedwig.protocol.PubSubProtocol.Message;
+import org.apache.hedwig.exceptions.PubSubException.UnexpectedConditionException;
+import org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId;
+import org.apache.hedwig.protocol.PubSubProtocol.RegionSpecificSeqId;
+
+public class MessageIdUtils {
+
+    public static String msgIdToReadableString(MessageSeqId seqId) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("local:");
+        sb.append(seqId.getLocalComponent());
+
+        String separator = ";";
+        for (RegionSpecificSeqId regionId : seqId.getRemoteComponentsList()) {
+            sb.append(separator);
+            sb.append(regionId.getRegion().toStringUtf8());
+            sb.append(':');
+            sb.append(regionId.getSeqId());
+        }
+        return sb.toString();
+    }
+
+    public static Map<ByteString, RegionSpecificSeqId> inMapForm(MessageSeqId msi) {
+        Map<ByteString, RegionSpecificSeqId> map = new HashMap<ByteString, RegionSpecificSeqId>();
+
+        for (RegionSpecificSeqId lmsid : msi.getRemoteComponentsList()) {
+            map.put(lmsid.getRegion(), lmsid);
+        }
+
+        return map;
+    }
+
+    public static boolean areEqual(MessageSeqId m1, MessageSeqId m2) {
+
+        if (m1.getLocalComponent() != m2.getLocalComponent()) {
+            return false;
+        }
+
+        if (m1.getRemoteComponentsCount() != m2.getRemoteComponentsCount()) {
+            return false;
+        }
+
+        Map<ByteString, RegionSpecificSeqId> m2map = inMapForm(m2);
+
+        for (RegionSpecificSeqId lmsid1 : m1.getRemoteComponentsList()) {
+            RegionSpecificSeqId lmsid2 = m2map.get(lmsid1.getRegion());
+            if (lmsid2 == null) {
+                return false;
+            }
+            if (lmsid1.getSeqId() != lmsid2.getSeqId()) {
+                return false;
+            }
+        }
+
+        return true;
+
+    }
+
+    public static Message mergeLocalSeqId(Message.Builder messageBuilder, long localSeqId) {
+        MessageSeqId.Builder msidBuilder = MessageSeqId.newBuilder(messageBuilder.getMsgId());
+        msidBuilder.setLocalComponent(localSeqId);
+        messageBuilder.setMsgId(msidBuilder);
+        return messageBuilder.build();
+    }
+
+    public static Message mergeLocalSeqId(Message orginalMessage, long localSeqId) {
+        return mergeLocalSeqId(Message.newBuilder(orginalMessage), localSeqId);
+    }
+
+    /**
+     * Compares two seq numbers represented as lists of longs.
+     * 
+     * @param l1
+     * @param l2
+     * @return 1 if the l1 is greater, 0 if they are equal, -1 if l2 is greater
+     * @throws UnexpectedConditionException
+     *             If the lists are of unequal length
+     */
+    public static int compare(List<Long> l1, List<Long> l2) throws UnexpectedConditionException {
+        if (l1.size() != l2.size()) {
+            throw new UnexpectedConditionException("Seq-ids being compared have different sizes: " + l1.size()
+                    + " and " + l2.size());
+        }
+
+        for (int i = 0; i < l1.size(); i++) {
+            long v1 = l1.get(i);
+            long v2 = l2.get(i);
+
+            if (v1 == v2) {
+                continue;
+            }
+
+            return v1 > v2 ? 1 : -1;
+        }
+
+        // All components equal
+        return 0;
+    }
+
+    /**
+     * Returns the element-wise vector maximum of the two vectors id1 and id2,
+     * if we imagine them to be sparse representations of vectors.
+     */
+    public static void takeRegionMaximum(MessageSeqId.Builder newIdBuilder, MessageSeqId id1, MessageSeqId id2) {
+        Map<ByteString, RegionSpecificSeqId> id2Map = MessageIdUtils.inMapForm(id2);
+
+        for (RegionSpecificSeqId rrsid1 : id1.getRemoteComponentsList()) {
+            ByteString region = rrsid1.getRegion();
+
+            RegionSpecificSeqId rssid2 = id2Map.get(region);
+
+            if (rssid2 == null) {
+                newIdBuilder.addRemoteComponents(rrsid1);
+                continue;
+            }
+
+            newIdBuilder.addRemoteComponents((rrsid1.getSeqId() > rssid2.getSeqId()) ? rrsid1 : rssid2);
+
+            // remove from map
+            id2Map.remove(region);
+        }
+
+        // now take the remaining components in the map and add them
+        for (RegionSpecificSeqId rssid2 : id2Map.values()) {
+            newIdBuilder.addRemoteComponents(rssid2);
+        }
+
+    }
+}

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/PubSubResponseUtils.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/PubSubResponseUtils.java?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/PubSubResponseUtils.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/PubSubResponseUtils.java Thu Aug 19 21:25:13 2010
@@ -0,0 +1,43 @@
+/**
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hedwig.protoextensions;
+
+import org.apache.hedwig.exceptions.PubSubException;
+import org.apache.hedwig.protocol.PubSubProtocol.ProtocolVersion;
+import org.apache.hedwig.protocol.PubSubProtocol.PubSubResponse;
+import org.apache.hedwig.protocol.PubSubProtocol.StatusCode;
+
+public class PubSubResponseUtils {
+
+    /**
+     * Change here if bumping up the version number that the server sends back
+     */
+    protected static ProtocolVersion serverVersion = ProtocolVersion.VERSION_ONE;
+
+    static PubSubResponse.Builder getBasicBuilder(StatusCode status) {
+        return PubSubResponse.newBuilder().setProtocolVersion(serverVersion).setStatusCode(status);
+    }
+
+    public static PubSubResponse getSuccessResponse(long txnId) {
+        return getBasicBuilder(StatusCode.SUCCESS).setTxnId(txnId).build();
+    }
+
+    public static PubSubResponse getResponseForException(PubSubException e, long txnId) {
+        return getBasicBuilder(e.getCode()).setStatusMsg(e.getMessage()).setTxnId(txnId).build();
+    }
+}

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/SubscriptionStateUtils.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/SubscriptionStateUtils.java?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/SubscriptionStateUtils.java (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/java/org/apache/hedwig/protoextensions/SubscriptionStateUtils.java Thu Aug 19 21:25:13 2010
@@ -0,0 +1,41 @@
+/**
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hedwig.protoextensions;
+
+import com.google.protobuf.ByteString;
+import org.apache.hedwig.protocol.PubSubProtocol.SubscriptionState;
+
+public class SubscriptionStateUtils {
+
+    // For now, to differentiate hub subscribers from local ones, the
+    // subscriberId will be prepended with a hard-coded prefix. Local
+    // subscribers will validate that the subscriberId used cannot start with
+    // this prefix. This is only used internally by the hub subscribers.
+    public static final String HUB_SUBSCRIBER_PREFIX = "__";
+
+    public static String toString(SubscriptionState state) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("consumeSeqId: " + MessageIdUtils.msgIdToReadableString(state.getMsgId()));
+        return sb.toString();
+    }
+
+    public static boolean isHubSubscriber(ByteString subscriberId) {
+        return subscriberId.toStringUtf8().startsWith(HUB_SUBSCRIBER_PREFIX);
+    }
+    
+}

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/protobuf/PubSubProtocol.proto
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/protobuf/PubSubProtocol.proto?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/protobuf/PubSubProtocol.proto (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/protocol/src/main/protobuf/PubSubProtocol.proto Thu Aug 19 21:25:13 2010
@@ -0,0 +1,175 @@
+/*
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+option java_package = "org.apache.hedwig.protocol";
+option optimize_for = SPEED;
+package Hedwig; 
+
+enum ProtocolVersion{
+    VERSION_ONE = 1;
+}
+
+/*
+ * this is the structure that will be serialized
+ */
+message Message {
+    required bytes body = 1;
+    optional bytes srcRegion = 2;
+    optional MessageSeqId msgId = 3;
+}
+
+message RegionSpecificSeqId {
+    required bytes region = 1;
+    required uint64 seqId = 2;
+}
+    
+message MessageSeqId{
+    optional uint64 localComponent = 1;
+    repeated RegionSpecificSeqId remoteComponents = 2;    
+}
+
+enum OperationType{
+    PUBLISH = 0;
+    SUBSCRIBE = 1;
+    CONSUME = 2;
+    UNSUBSCRIBE = 3;
+    
+    //the following two are only used for the hedwig proxy
+    START_DELIVERY = 4;
+    STOP_DELIVERY = 5;
+}
+
+/* A PubSubRequest is just a union of the various request types, with
+ * an enum telling us which type it is. The same can also be done through 
+ * extensions. We need one request type that we will deserialize into on 
+ * the server side.
+ */
+message PubSubRequest{
+    
+    required ProtocolVersion protocolVersion = 1;
+    required OperationType type = 2;
+    repeated bytes triedServers = 3;
+    required uint64 txnId = 4;
+    optional bool shouldClaim = 5;
+    required bytes topic = 6;
+    //any authentication stuff and other general stuff here
+    
+    
+    /* one entry for each type of request */
+    optional PublishRequest publishRequest = 52; 
+    optional SubscribeRequest subscribeRequest = 53;
+    optional ConsumeRequest consumeRequest = 54;
+    optional UnsubscribeRequest unsubscribeRequest = 55;
+    optional StopDeliveryRequest stopDeliveryRequest = 56;
+    optional StartDeliveryRequest startDeliveryRequest = 57;
+}
+
+
+
+message PublishRequest{
+    required Message msg = 2;
+}
+
+message SubscribeRequest{
+    required bytes subscriberId = 2;
+	
+	enum CreateOrAttach{
+	    CREATE = 0;
+	    ATTACH = 1;
+	    CREATE_OR_ATTACH = 2;
+	};
+	optional CreateOrAttach createOrAttach = 3 [default = CREATE_OR_ATTACH];
+	
+	// wait for cross-regional subscriptions to be established before returning
+	optional bool synchronous = 4 [default = false];
+}
+
+message ConsumeRequest{
+    required bytes subscriberId = 2;    
+    required MessageSeqId msgId = 3;
+    //the msgId is cumulative: all messages up to this id are marked as consumed
+}
+
+message UnsubscribeRequest{
+    required bytes subscriberId = 2;
+}
+
+
+message StopDeliveryRequest{
+    required bytes subscriberId = 2;
+}
+
+message StartDeliveryRequest{
+    required bytes subscriberId = 2;
+}
+
+message PubSubResponse{
+    required ProtocolVersion protocolVersion = 1;
+    required StatusCode statusCode = 2;
+    required uint64 txnId = 3;
+    
+    
+    optional string statusMsg = 4;
+    //in case of a status code of NOT_RESPONSIBLE_FOR_TOPIC, the status
+    //message will contain the name of the host actually responsible 
+    //for the topic
+    
+    //the following fields are sent in delivered messages
+    optional Message message = 5;
+    optional bytes topic = 6;
+    optional bytes subscriberId = 7;
+}
+
+
+enum StatusCode{
+    SUCCESS = 0;
+    
+    //client-side errors (4xx)
+    MALFORMED_REQUEST = 401;
+    NO_SUCH_TOPIC = 402;
+    CLIENT_ALREADY_SUBSCRIBED = 403;
+    CLIENT_NOT_SUBSCRIBED = 404;
+    COULD_NOT_CONNECT = 405;
+    TOPIC_BUSY = 406;
+    
+    //server-side errors (5xx)
+    NOT_RESPONSIBLE_FOR_TOPIC = 501;
+    SERVICE_DOWN = 502;
+    UNCERTAIN_STATE = 503;
+    
+    //For all unexpected error conditions
+    UNEXPECTED_CONDITION = 600;
+    
+    COMPOSITE = 700;
+}
+  
+//What follows is not the server client protocol, but server-internal structures that are serialized in ZK  
+//They should eventually be moved into the server 
+    
+message SubscriptionState {
+    required MessageSeqId msgId = 1;
+}
+
+message LedgerRange{
+    required uint64 ledgerId = 1;
+    optional MessageSeqId endSeqIdIncluded = 2;
+}
+
+message LedgerRanges{
+    repeated LedgerRange ranges = 1;
+}
+

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/README.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/README.txt?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/README.txt (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/README.txt Thu Aug 19 21:25:13 2010
@@ -0,0 +1,39 @@
+To start up a Hedwig server, you can make use of the scripts in this directory.
+The hw.bash script is used to setup a Hedwig region cluster on remote boxes.
+It contains methods that allow the user to start up a ZooKeeper server
+(currently only a single quorum) and also any number of Bookkeeper servers.
+It can also startup any number of Hedwig server hubs that point to this
+ZooKeeper/Bookkeeper setup.
+
+To simplify and generalize things, the hwServer.sh script is used to start
+up a single Hedwig server hub on the current local machine. It assumes that
+the ZooKeeper and Bookkeeper servers are setup and running already. The order
+of operations prior to starting up the Hedwig server hub(s) is:
+
+1. Startup a quorum of ZooKeeper servers (could be a single one).
+2. Using a ZooKeeper client to connect to the servers, create the following 
+ZK nodes to be used by Bookkeeper as directory path nodes.
+	/ledgers and /ledgers/available
+3. Startup Bookkeeper servers pointing them to this ZooKeeper quorum.
+4. For each machine you want to run a Hedwig server hub on, the Hedwig code
+needs to be there. Compile/build it from the top level with the command: 
+	mvn install -Dmaven.test.skip=true
+In the server/target directory, this creates the following fat jar that
+contains all dependencies the Hedwig server needs to run:
+	server-1.0-SNAPSHOT-jar-with-dependencies.jar
+5. Define your Hedwig server configuration before you start the server. The
+default location and file for this is: 
+	conf/hw_server.conf
+However, you can override this by setting the appropriate environment
+variables or passing in your config file directly when invoking the
+hwServer.sh script. A sample config file is available for you at:
+	conf/hw_server_sample.conf
+The important config parameter is the "zk_host" one which will point the
+Hedwig server hub to the ZooKeeper quorum which manages and coordinates all of
+the hubs.
+6. Run the hwServer.sh script to start up the server:
+	scripts/hwServer.sh start
+OR	scripts/hwServer.sh start <path to your Hedwig server config file>
+7. Stop or restart the Hedwig server hub using the following commands:
+	scripts/hwServer.sh stop
+	scripts/hwServer.sh restart

Added: hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/analyze.py
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/analyze.py?rev=987314&view=auto
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/analyze.py (added)
+++ hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/analyze.py Thu Aug 19 21:25:13 2010
@@ -0,0 +1,201 @@
+#!/usr/bin/env python
+
+#  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
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+from __future__ import with_statement
+import sys, os, glob, re, collections, math, subprocess, unittest
+from numpy import *
+from commons import seqs, startup, strs, structs
+import cairo
+from pycha.bar import *
+
+def sub():
+
+  #
+  # Parse/aggregate.
+  #
+
+  tputs = collections.defaultdict(list)
+  lats = collections.defaultdict(list)
+  for fname in glob.glob('sync-*-count-*-npar-*-rep-*.out'):
+    m = re.match(r'sync-(\d+)-count-(\d+)-npar-(\d+)-rep-(\d+)\.out', fname)
+    sync, count, npar, rep = map(int, m.groups())
+    with file(fname) as f:
+      m = re.search(r'finished subs, tput = ([\d\.]+) ops/s, avg latency = (\d+)', f.readlines()[-2])
+      tput, lat = map(float, m.groups())
+    tputs[sync, count, npar].append(tput)
+    lats[sync, count, npar].append(lat)
+  for d in tputs, lats:
+    for k in d:
+      d[k] = array(d[k]).mean(), array(d[k]).std()
+      print k, d[k]
+
+  #
+  # Plot.
+  #
+
+  for title, ylabel, fname, d in [ ('Subscription throughput over three trials', 'Subscriptions per second', 'tput', tputs),
+                                   ('Subscription latency over three trials', 'Round-trip time in ms', 'lat', lats) ]:
+    means = dict((k, v[0]) for k,v in d.iteritems())
+    sdevs = dict((k, v[1]) for k,v in d.iteritems())
+
+    surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 500, 400)
+    syncs, counts, npars = [ sorted(set(x[i] for x in means))
+                                for i in xrange(3) ]
+    print syncs, counts, npars
+    dataset = [ ( '%d topics, %s' %
+                    ( count, 'synchronous' if sync else 'asynchronous' ),
+                  [ ( npar/10, means[sync, count, npar], sdevs[sync, count, npar] )
+                    for npar in npars ] )
+                for count in counts
+                for sync in syncs ]
+    options = {'legend.position':
+                {'top': None, 'left': None, 'bottom': 100, 'right': 20},
+               'axis.x.ticks': [{'v': x, 'label': max(1,10*x)}
+                                for i,(x,y,e) in enumerate(dataset[0][1])],
+               'axis.x.label': 'Number of outstanding subscription requests',
+               'axis.y.label': ylabel,
+               'padding.left': 50,
+               'title': title,
+               'background.color': '#f0f0f0'}
+    chart = VerticalBarChart(surface, structs.sparse_dict(options))
+    chart.addDataset(dataset)
+    chart.render()
+    surface.write_to_png(fname + '.png')
+
+def pub():
+
+  def helper(do_pubs):
+
+    def subhelper(keyname, pat, xlabel):
+
+      #
+      # Parse/aggregate.
+      #
+
+      print 'Analyzing', keyname, 'for', 'publishers' if do_pubs else 'receivers'
+      print '========================'
+      print
+
+      tputs = collections.defaultdict(list)
+      lats = collections.defaultdict(list)
+      fnames = [ ( fname, tuple(map(int, m.groups())) )
+                 for fname, m in filter( lambda m: m[1] is not None,
+                                         ( ( fname, re.match(pat, fname) )
+                                           for fname in os.listdir('.') ) ) ]
+      tup2fname = dict( (tup, fname) for fname, tup in fnames )
+      keys, reps, nodes = map(lambda xs: sorted(set(xs)),
+                              zip(*(tup for fname, tup in fnames)))
+
+      raw_table = []
+      print '== raw data =='
+      raw_table.append( [ keyname, 'rep', 'node', 'tput' ] + ( ['lat'] if do_pubs else [] ) + ['sum/mean tput', 'mean lat'] )
+      for key in keys:
+        for rep in reps:
+          tmptputs = []
+          tmplats = []
+          for node in nodes:
+            if (key, rep, node) in tup2fname:
+              with file(tup2fname[key, rep, node]) as f:
+                try:
+                  if do_pubs:
+                    m = re.search(r'finished acked pubs, tput = ([\d\.]+) ops/s, avg latency = (\d+)', f.readlines()[-2])
+                    tput, lat = map(float, m.groups())
+                  else:
+                    m = re.search(r'finished recvs, tput = ([\d\.]+) ops/s', f.read())
+                    [tput] = map(float, m.groups())
+                except AttributeError:
+                  print >> sys.stderr, "While processing", tup2fname[key, rep, node]
+                  raise
+              raw_table.append( [ key, rep, node, tput ] + ( [lat] if do_pubs else [] ) + ['',''] )
+              tmptputs.append(tput)
+              if do_pubs: tmplats.append(lat)
+          if keyname == 'npubs': tputs[key].append(sum(tmptputs))
+          else: tputs[key].append(array(tmptputs).mean())
+          if do_pubs: lats[key].append(array(tmplats).mean())
+          if len(nodes) > 1:
+            raw_table.append( [''] * (len(raw_table[0]) - 2) + [tputs[key][-1]] + ( [lats[key][-1]] if do_pubs else [] ) )
+      print strs.show_table_by_rows(raw_table)
+      print
+
+      print '== aggregated over reps =='
+      agg_table = []
+      agg_table.append( ( keyname, 'mean', 'sd' ) )
+      for d in tputs, lats:
+        for k in d:
+          d[k] = array(d[k]).mean(), array(d[k]).std()
+          agg_table.append( ( k, d[k][0], d[k][1] ) )
+      print strs.show_table_by_rows(agg_table)
+      print
+
+      #
+      # Plot.
+      #
+
+      if do_pubs:
+        plots = [ ('Publishing throughput over three trials', 'Publishes per second', '%s-pub-tput' % keyname, tputs),
+                  ('Publishing latency over three trials', 'Round-trip time in ms', '%s-pub-lat' % keyname, lats) ]
+      else:
+        plots = [ ('Receiving throughput over three trials', 'Receives per second', '%s-recv-tput' % keyname, tputs) ]
+      for title, ylabel, fname, d in plots:
+        means = dict((k, v[0]) for k,v in d.iteritems())
+        sdevs = dict((k, v[1]) for k,v in d.iteritems())
+
+        surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 500, 400)
+        dataset = [ ( 'main',
+                      [ ( i, means[key], sdevs[key] )
+                        for i, key in enumerate(keys) ] ) ]
+        options = {'legend.position':
+                    {'top': None, 'left': None, 'bottom': 100, 'right': 20},
+                   'axis.x.ticks': [{'v': x, 'label': k}
+                                    for k,(x,y,e) in zip(keys, dataset[0][1])],
+                   'axis.x.label': xlabel,
+                   'axis.y.label': ylabel,
+                   'padding.left': 50,
+                   'title': title,
+                   'background.color': '#f0f0f0'}
+        chart = VerticalBarChart(surface, structs.sparse_dict(options))
+        chart.addDataset(dataset)
+        chart.render()
+        surface.write_to_png(fname + '.png')
+
+      print
+      print
+      print
+
+    nodetype = 'pub' if do_pubs else 'recv'
+    mode_npar = seqs.mode(
+        int(m.group(1)) for m in
+        [re.search('npar-(\d+)', fname) for fname in os.listdir('.')]
+        if m is not None )
+    subhelper('nrecvs', 'nrecvs-(\d+)-npubs-1-npar-%s-rep-(\d+)-%s-(\d+)' % (mode_npar, nodetype),
+              'Number of receivers')
+    subhelper('npubs', 'nrecvs-1-npubs-(\d+)-npar-%s-rep-(\d+)-%s-(\d+)' % (mode_npar, nodetype),
+              'Number of publishers')
+    subhelper('npar', 'nrecvs-1-npubs-1-npar-(\d+)-rep-(\d+)-%s-(0)' % nodetype,
+              'Number of outstanding publish requests')
+
+  helper(True)
+  helper(False)
+
+def main(argv):
+  if argv[1] == 'sub': sub()
+  elif argv[1] == 'pub': pub()
+  else: return unittest.main()
+
+startup.run_main()
+
+# vim: et sw=2 ts=2

Propchange: hadoop/zookeeper/trunk/src/contrib/hedwig/scripts/analyze.py
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message