// Path: giraffa-core/src/main/java/org/apache/giraffa/GiraffaConfiguration.java
// public class GiraffaConfiguration extends Configuration {
//   public static final String  GRFA_URI_SCHEME = "grfa";
//   public static final String  GRFA_TABLE_NAME_KEY = "grfa.table.name";
//   public static final String  GRFA_TABLE_NAME_DEFAULT = "Namespace";
//   public static final String  GRFA_ROWKEY_FACTORY_KEY =
//       "grfa.rowkey.factory.class";
//   public static final Class<? extends RowKeyFactory>
//                 GRFA_ROWKEY_FACTORY_DEFAULT = FullPathRowKeyFactory.class;
//   public static final String  GRFA_CACHING_KEY = "grfa.rowkey.caching";
//   public static final Boolean GRFA_CACHING_DEFAULT = true;
//   public static final String  GRFA_NAMESPACE_SERVICE_KEY = 
//                                   "grfa.namespace.service.class"; 
//   public static final Class<? extends NamespaceService>
//                 GRFA_NAMESPACE_SERVICE_DEFAULT = NamespaceAgent.class;
//   public static final String  GRFA_HDFS_ADDRESS_KEY = "grfa.hdfs.address";
//   public static final String  GRFA_HDFS_ADDRESS_DEFAULT = "file:///";
//   public static final String  GRFA_HBASE_ADDRESS_KEY = "grfa.hbase.address";
//   public static final String  GRFA_HBASE_ADDRESS_DEFAULT = "file:///";
//   public static final String  GRFA_LIST_LIMIT_KEY =
//                                   DFSConfigKeys.DFS_LIST_LIMIT;
//   public static final int     GRFA_LIST_LIMIT_DEFAULT =
//                                   DFSConfigKeys.DFS_LIST_LIMIT_DEFAULT;
// 
//   public static final String  GRFA_WEB_ADDRESS_KEY = "grfa.http-address";
//   public static final String  GRFA_WEB_ADDRESS_DEFAULT = "0.0.0.0:40010";
// 
//   static {
//     // adds the default resources
//     addDefaultResource("giraffa-default.xml");
//     addDefaultResource("giraffa-site.xml");
//     addDefaultResource("hbase-default.xml");
//     addDefaultResource("hbase-site.xml");
//   }
// 
//   public GiraffaConfiguration() {
//     super();
//   }
// 
//   public GiraffaConfiguration(Configuration conf) {
//     super(conf);
//   }
// 
//   public NamespaceService newNamespaceService() {
//     Class<? extends NamespaceService> serviceClass =
//         getClass(GRFA_NAMESPACE_SERVICE_KEY, GRFA_NAMESPACE_SERVICE_DEFAULT,
//             NamespaceService.class);
//     return ReflectionUtils.newInstance(serviceClass, null);
//   }
// 
//   public static String getGiraffaTableName(Configuration conf) {
//     return conf.get(GRFA_TABLE_NAME_KEY, GRFA_TABLE_NAME_DEFAULT);
//   }
// }


import java.io.IOException;
import java.net.InetSocketAddress;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.giraffa.GiraffaConfiguration;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.coprocessor.BaseMasterObserver;
import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.net.NetUtils;
import javax.servlet.jsp.jstl.core.Config;
/**
 * 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.giraffa.web;



public class GiraffaWebObserver extends BaseMasterObserver {

  private static final Log LOG = LogFactory.getLog(GiraffaWebObserver.class);

  // server for the web ui
  private GiraffaWebServer giraffaServer;

  private Connection connection;

  private InetSocketAddress getHttpServerAddress(Configuration conf) {
    return  NetUtils.createSocketAddr(
// Path: giraffa-core/src/main/java/org/apache/giraffa/GiraffaConfiguration.java
// public class GiraffaConfiguration extends Configuration {
//   public static final String  GRFA_URI_SCHEME = "grfa";
//   public static final String  GRFA_TABLE_NAME_KEY = "grfa.table.name";
//   public static final String  GRFA_TABLE_NAME_DEFAULT = "Namespace";
//   public static final String  GRFA_ROWKEY_FACTORY_KEY =
//       "grfa.rowkey.factory.class";
//   public static final Class<? extends RowKeyFactory>
//                 GRFA_ROWKEY_FACTORY_DEFAULT = FullPathRowKeyFactory.class;
//   public static final String  GRFA_CACHING_KEY = "grfa.rowkey.caching";
//   public static final Boolean GRFA_CACHING_DEFAULT = true;
//   public static final String  GRFA_NAMESPACE_SERVICE_KEY = 
//                                   "grfa.namespace.service.class"; 
//   public static final Class<? extends NamespaceService>
//                 GRFA_NAMESPACE_SERVICE_DEFAULT = NamespaceAgent.class;
//   public static final String  GRFA_HDFS_ADDRESS_KEY = "grfa.hdfs.address";
//   public static final String  GRFA_HDFS_ADDRESS_DEFAULT = "file:///";
//   public static final String  GRFA_HBASE_ADDRESS_KEY = "grfa.hbase.address";
//   public static final String  GRFA_HBASE_ADDRESS_DEFAULT = "file:///";
//   public static final String  GRFA_LIST_LIMIT_KEY =
//                                   DFSConfigKeys.DFS_LIST_LIMIT;
//   public static final int     GRFA_LIST_LIMIT_DEFAULT =
//                                   DFSConfigKeys.DFS_LIST_LIMIT_DEFAULT;
// 
//   public static final String  GRFA_WEB_ADDRESS_KEY = "grfa.http-address";
//   public static final String  GRFA_WEB_ADDRESS_DEFAULT = "0.0.0.0:40010";
// 
//   static {
//     // adds the default resources
//     addDefaultResource("giraffa-default.xml");
//     addDefaultResource("giraffa-site.xml");
//     addDefaultResource("hbase-default.xml");
//     addDefaultResource("hbase-site.xml");
//   }
// 
//   public GiraffaConfiguration() {
//     super();
//   }
// 
//   public GiraffaConfiguration(Configuration conf) {
//     super(conf);
//   }
// 
//   public NamespaceService newNamespaceService() {
//     Class<? extends NamespaceService> serviceClass =
//         getClass(GRFA_NAMESPACE_SERVICE_KEY, GRFA_NAMESPACE_SERVICE_DEFAULT,
//             NamespaceService.class);
//     return ReflectionUtils.newInstance(serviceClass, null);
//   }
// 
//   public static String getGiraffaTableName(Configuration conf) {
//     return conf.get(GRFA_TABLE_NAME_KEY, GRFA_TABLE_NAME_DEFAULT);
//   }
// }


// Path: giraffa-core/src/main/java/org/apache/giraffa/web/GiraffaWebObserver.java
import java.io.IOException;
import java.net.InetSocketAddress;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.giraffa.GiraffaConfiguration;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.coprocessor.BaseMasterObserver;
import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.net.NetUtils;
import javax.servlet.jsp.jstl.core.Config;

/**
 * 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.giraffa.web;



public class GiraffaWebObserver extends BaseMasterObserver {

  private static final Log LOG = LogFactory.getLog(GiraffaWebObserver.class);

  // server for the web ui
  private GiraffaWebServer giraffaServer;

  private Connection connection;

  private InetSocketAddress getHttpServerAddress(Configuration conf) {
    return  NetUtils.createSocketAddr(
        conf.get(GiraffaConfiguration.GRFA_WEB_ADDRESS_KEY,