hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r928876 [1/13] - in /hadoop/hbase/trunk: ./ contrib/stargate/ contrib/stargate/conf/ contrib/stargate/core/ contrib/stargate/core/src/ contrib/stargate/core/src/main/ contrib/stargate/core/src/main/java/ contrib/stargate/core/src/main/java/...
Date Mon, 29 Mar 2010 19:15:20 GMT
Author: apurtell
Date: Mon Mar 29 19:15:15 2010
New Revision: 928876

URL: http://svn.apache.org/viewvc?rev=928876&view=rev
Log:
HBASE-2348 [stargate] Stargate needs both JAR and WAR artifacts

Added:
    hadoop/hbase/trunk/contrib/stargate/core/
    hadoop/hbase/trunk/contrib/stargate/core/pom.xml
    hadoop/hbase/trunk/contrib/stargate/core/src/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Constants.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Main.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ProtobufMessageHandler.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RESTServlet.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RegionsResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResourceConfig.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResultGenerator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RootResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResultGenerator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowSpec.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ScannerInstanceResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ScannerResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ScannerResultGenerator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/SchemaResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/StorageClusterStatusResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/StorageClusterVersionResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/TableResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/User.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/VersionResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/auth/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/auth/Authenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/auth/HBCAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/auth/HTableAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/auth/JDBCAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/auth/ZooKeeperAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/client/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/client/Client.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/client/Cluster.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/client/Response.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/metrics/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/metrics/StargateMetrics.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/metrics/StargateStatistics.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/CellModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/CellSetModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/ColumnSchemaModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/RowModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/ScannerModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/StorageClusterStatusModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/StorageClusterVersionModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/TableInfoModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/TableListModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/TableModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/TableRegionModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/TableSchemaModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/model/VersionModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/CellMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/CellSetMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/ColumnSchemaMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/ScannerMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/StorageClusterStatusMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/TableInfoMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/TableListMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/TableSchemaMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/VersionMessage.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/provider/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/provider/JAXBContextResolver.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/provider/consumer/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/provider/consumer/ProtobufMessageBodyConsumer.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/provider/producer/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/provider/producer/PlainTextMessageBodyProducer.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/provider/producer/ProtobufMessageBodyProducer.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/util/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/util/HTableTokenBucket.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/util/SoftUserData.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/util/TokenBucket.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/util/UserData.java
    hadoop/hbase/trunk/contrib/stargate/core/src/main/javadoc/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/javadoc/org/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/javadoc/org/apache/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/javadoc/org/apache/hadoop/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/javadoc/org/apache/hadoop/hbase/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/javadoc/org/apache/hadoop/hbase/stargate/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/javadoc/org/apache/hadoop/hbase/stargate/package.html
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/model/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/model/ModelSchema.xsd
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/CellMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/CellSetMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/ColumnSchemaMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/ScannerMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/StorageClusterStatusMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/TableInfoMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/TableListMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/TableSchemaMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/VersionMessage.proto
    hadoop/hbase/trunk/contrib/stargate/core/src/test/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/MiniClusterTestBase.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/Test00MiniCluster.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/TestRowResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/TestScannerResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/TestScannersWithFilters.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/TestSchemaResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/TestStatusResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/TestTableResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/TestVersionResource.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/auth/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/auth/TestHBCAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/auth/TestHTableAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/auth/TestJDBCAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/auth/TestZooKeeperAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestCellModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestCellSetModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestColumnSchemaModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestRowModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestScannerModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestStorageClusterStatusModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestStorageClusterVersionModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestTableInfoModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestTableListModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestTableRegionModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestTableSchemaModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/model/TestVersionModel.java
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/util/
    hadoop/hbase/trunk/contrib/stargate/core/src/test/java/org/apache/hadoop/hbase/stargate/util/TestHTableTokenBucket.java
    hadoop/hbase/trunk/contrib/stargate/war/
    hadoop/hbase/trunk/contrib/stargate/war/pom.xml
    hadoop/hbase/trunk/contrib/stargate/war/src/
    hadoop/hbase/trunk/contrib/stargate/war/src/main/
    hadoop/hbase/trunk/contrib/stargate/war/src/main/webapp/
    hadoop/hbase/trunk/contrib/stargate/war/src/main/webapp/WEB-INF/
    hadoop/hbase/trunk/contrib/stargate/war/src/main/webapp/WEB-INF/jetty.xml
    hadoop/hbase/trunk/contrib/stargate/war/src/main/webapp/WEB-INF/web.xml
Removed:
    hadoop/hbase/trunk/contrib/stargate/conf/jetty.xml
    hadoop/hbase/trunk/contrib/stargate/conf/web.xml
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/Constants.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/Main.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/ProtobufMessageHandler.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/RESTServlet.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/RegionsResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/ResourceConfig.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/ResultGenerator.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/RootResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/RowResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/RowResultGenerator.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/RowSpec.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/ScannerInstanceResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/ScannerResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/ScannerResultGenerator.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/SchemaResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/StorageClusterStatusResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/StorageClusterVersionResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/TableResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/User.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/VersionResource.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/auth/Authenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/auth/HBCAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/auth/HTableAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/auth/JDBCAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/auth/ZooKeeperAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/client/Client.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/client/Cluster.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/client/Response.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/metrics/StargateMetrics.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/metrics/StargateStatistics.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/CellModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/CellSetModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/ColumnSchemaModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/RowModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/ScannerModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/StorageClusterStatusModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/StorageClusterVersionModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/TableInfoModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/TableListModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/TableModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/TableRegionModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/TableSchemaModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/model/VersionModel.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/CellMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/CellSetMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/ColumnSchemaMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/ScannerMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/StorageClusterStatusMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/TableInfoMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/TableListMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/TableSchemaMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/protobuf/generated/VersionMessage.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/provider/JAXBContextResolver.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/provider/consumer/ProtobufMessageBodyConsumer.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/provider/producer/PlainTextMessageBodyProducer.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/provider/producer/ProtobufMessageBodyProducer.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/util/HTableTokenBucket.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/util/SoftUserData.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/util/TokenBucket.java
    hadoop/hbase/trunk/contrib/stargate/src/main/java/org/apache/hadoop/hbase/stargate/util/UserData.java
    hadoop/hbase/trunk/contrib/stargate/src/main/javadoc/org/apache/hadoop/hbase/stargate/package.html
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/model/ModelSchema.xsd
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/CellMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/CellSetMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/ColumnSchemaMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/ScannerMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/StorageClusterStatusMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/TableInfoMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/TableListMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/TableSchemaMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/main/resources/org/apache/hadoop/hbase/stargate/protobuf/VersionMessage.proto
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/MiniClusterTestBase.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/Test00MiniCluster.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/TestRowResource.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/TestScannerResource.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/TestScannersWithFilters.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/TestSchemaResource.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/TestStatusResource.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/TestTableResource.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/TestVersionResource.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/auth/TestHBCAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/auth/TestHTableAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/auth/TestJDBCAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/auth/TestZooKeeperAuthenticator.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestCellModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestCellSetModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestColumnSchemaModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestRowModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestScannerModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestStorageClusterStatusModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestStorageClusterVersionModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestTableInfoModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestTableListModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestTableRegionModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestTableSchemaModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/model/TestVersionModel.java
    hadoop/hbase/trunk/contrib/stargate/src/test/java/org/apache/hadoop/hbase/stargate/util/TestHTableTokenBucket.java
Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/contrib/stargate/pom.xml
    hadoop/hbase/trunk/src/assembly/bin.xml

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=928876&r1=928875&r2=928876&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Mar 29 19:15:15 2010
@@ -460,6 +460,8 @@ Release 0.21.0 - Unreleased
                (Aravind Menon via Stack)
    HBASE-2359  WALEdit doesn't implement HeapSize
                (Kannan Muthukkaruppan via Stack)
+   HBASE-2348  [stargate] Stargate needs both JAR and WAR artifacts (Paul Smith
+               via Andrew Purtell)
 
   NEW FEATURES
    HBASE-1961  HBase EC2 scripts

Added: hadoop/hbase/trunk/contrib/stargate/core/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/pom.xml?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/pom.xml (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/pom.xml Mon Mar 29 19:15:15 2010
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+  <artifactId>hbase-contrib-stargate-core</artifactId>
+  <packaging>jar</packaging>
+  <name>HBase Contrib - Stargate Core</name>
+  
+  <parent>
+    <groupId>org.apache.hbase</groupId>
+    <artifactId>hbase-contrib-stargate</artifactId>
+    <version>0.21.0-SNAPSHOT</version>
+  </parent>
+
+  <properties>
+    <jsr311.version>1.1.1</jsr311.version>
+    <protobuf.version>2.3.0</protobuf.version>
+    <jersey.version>1.1.4.1</jersey.version>
+    <json.version>20090211</json.version>
+    <hsqldb.version>1.8.0.10</hsqldb.version>
+    <commons-httpclient.version>3.0.1</commons-httpclient.version>
+  </properties>
+
+  
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>hbase-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>hbase-core</artifactId>
+      <classifier>tests</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-test</artifactId>
+      <version>${hadoop.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.ws.rs</groupId>
+      <artifactId>jsr311-api</artifactId>
+      <version>${jsr311.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.google.protobuf</groupId>
+      <artifactId>protobuf-java</artifactId>
+      <version>${protobuf.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-json</artifactId>
+      <version>${jersey.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-server</artifactId>
+      <version>${jersey.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>${commons-httpclient.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.json</groupId>
+      <artifactId>json</artifactId>
+      <version>${json.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>${hsqldb.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Constants.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Constants.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Constants.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Constants.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+/**
+ * Common constants for org.apache.hadoop.hbase.stargate
+ */
+public interface Constants {
+  public static final String VERSION_STRING = "0.0.2";
+
+  public static final String AUTHENTICATOR_KEY = "stargate.authenticator";
+  public static final String MULTIUSER_KEY = "stargate.multiuser";
+  public static final String STATUS_REPORT_PERIOD_KEY =
+    "stargate.status.period";
+
+  public static final String USERS_TABLE = "users";
+
+  public static final String INSTANCE_ZNODE_ROOT = "/stargate/instance";
+  public static final String USERS_ZNODE_ROOT = "/stargate/users";
+
+  public static final int DEFAULT_MAX_AGE = 60 * 60 * 4;  // 4 hours
+
+  public static final String MIMETYPE_TEXT = "text/plain";
+  public static final String MIMETYPE_HTML = "text/html";
+  public static final String MIMETYPE_XML = "text/xml";
+  public static final String MIMETYPE_BINARY = "application/octet-stream";
+  public static final String MIMETYPE_PROTOBUF = "application/x-protobuf";
+  public static final String MIMETYPE_JSON = "application/json";
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Main.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Main.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Main.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/Main.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2009 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.PosixParser;
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.Context;
+import org.mortbay.jetty.servlet.ServletHolder;
+
+import com.sun.jersey.spi.container.servlet.ServletContainer;
+
+/**
+ * Main class for launching Stargate as a servlet hosted by an embedded Jetty
+ * servlet container.
+ * <p> 
+ * The following options are supported:
+ * <ul>
+ * <li>-p: service port</li>
+ * </ul>
+ */
+public class Main implements Constants {
+
+  public static void main(String[] args) throws Exception {
+    // process command line
+
+    Options options = new Options();
+    options.addOption("p", "port", true, "service port");
+    options.addOption("m", "multiuser", false, "enable multiuser mode");
+    CommandLineParser parser = new PosixParser();
+    CommandLine cmd = parser.parse(options, args);
+    int port = 8080;
+    if (cmd.hasOption("p")) {
+      port = Integer.valueOf(cmd.getOptionValue("p"));
+    }
+
+    // set up the Jersey servlet container for Jetty
+
+    ServletHolder sh = new ServletHolder(ServletContainer.class);
+    sh.setInitParameter(
+      "com.sun.jersey.config.property.resourceConfigClass",
+      ResourceConfig.class.getCanonicalName());
+    sh.setInitParameter("com.sun.jersey.config.property.packages",
+      "jetty");
+
+    // set up Jetty and run the embedded server
+
+    Server server = new Server(port);
+    server.setSendServerVersion(false);
+    server.setSendDateHeader(false);
+    server.setStopAtShutdown(true);
+      // set up context
+    Context context = new Context(server, "/", Context.SESSIONS);
+    context.addServlet(sh, "/*");
+
+    // configure the Stargate singleton
+
+    RESTServlet servlet = RESTServlet.getInstance();
+    servlet.setMultiUser(cmd.hasOption("m"));
+    for (Connector conn: server.getConnectors()) {
+      servlet.addConnectorAddress(conn.getHost(), conn.getLocalPort());
+    }
+
+    server.start();
+    server.join();
+  }
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ProtobufMessageHandler.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ProtobufMessageHandler.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ProtobufMessageHandler.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ProtobufMessageHandler.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import java.io.IOException;
+
+/**
+ * Common interface for models capable of supporting protobuf marshalling
+ * and unmarshalling. Hooks up to the ProtobufMessageBodyConsumer and
+ * ProtobufMessageBodyProducer adapters. 
+ */
+public abstract interface ProtobufMessageHandler {
+  /**
+   * @return the protobuf represention of the model
+   */
+  public byte[] createProtobufOutput();
+
+  /**
+   * Initialize the model from a protobuf representation.
+   * @param message the raw bytes of the protobuf message
+   * @return reference to self for convenience
+   * @throws IOException
+   */
+  public ProtobufMessageHandler getObjectFromMessage(byte[] message)
+    throws IOException;
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RESTServlet.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RESTServlet.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RESTServlet.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RESTServlet.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,357 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.Chore;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HColumnDescriptor;
+import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.HTablePool;
+import org.apache.hadoop.hbase.stargate.auth.Authenticator;
+import org.apache.hadoop.hbase.stargate.auth.HBCAuthenticator;
+import org.apache.hadoop.hbase.stargate.auth.HTableAuthenticator;
+import org.apache.hadoop.hbase.stargate.auth.JDBCAuthenticator;
+import org.apache.hadoop.hbase.stargate.auth.ZooKeeperAuthenticator;
+import org.apache.hadoop.hbase.stargate.metrics.StargateMetrics;
+import org.apache.hadoop.hbase.stargate.util.HTableTokenBucket;
+import org.apache.hadoop.hbase.stargate.util.SoftUserData;
+import org.apache.hadoop.hbase.stargate.util.UserData;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.Pair;
+import org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper;
+
+import org.apache.hadoop.util.StringUtils;
+
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.WatchedEvent;
+import org.apache.zookeeper.Watcher;
+import org.apache.zookeeper.ZooKeeper;
+import org.apache.zookeeper.Watcher.Event.EventType;
+import org.apache.zookeeper.Watcher.Event.KeeperState;
+import org.apache.zookeeper.ZooDefs.Ids;
+import org.apache.zookeeper.data.Stat;
+
+import org.json.JSONStringer;
+
+import com.sun.jersey.server.impl.container.servlet.ServletAdaptor;
+
+/**
+ * Singleton class encapsulating global REST servlet state and functions.
+ */
+public class RESTServlet extends ServletAdaptor 
+    implements Constants, Watcher {
+
+  private static final Log LOG = LogFactory.getLog(RESTServlet.class);
+  private static final long serialVersionUID = 1L;
+
+  private static RESTServlet instance;
+
+  class StatusReporter extends Chore {
+
+    public StatusReporter(int period, AtomicBoolean stopping) {
+      super(period, stopping);
+    }
+
+    @Override
+    protected void chore() {
+      if (wrapper != null) try {
+        JSONStringer status = new JSONStringer();
+        status.object();
+        status.key("requests").value(metrics.getRequests());
+        status.key("connectors").array();
+        for (Pair<String,Integer> e: connectors) {
+          status.object()
+            .key("host").value(e.getFirst())
+            .key("port").value(e.getSecond())
+            .endObject();
+        }
+        status.endArray();
+        status.endObject();
+        updateNode(wrapper, znode, CreateMode.EPHEMERAL, 
+          Bytes.toBytes(status.toString()));
+      } catch (Exception e) {
+        LOG.error(StringUtils.stringifyException(e));
+      }
+    }
+
+  }
+
+  final String znode = INSTANCE_ZNODE_ROOT + "/" + System.currentTimeMillis();
+  transient final Configuration conf;
+  transient final HTablePool pool;
+  transient volatile ZooKeeperWrapper wrapper;
+  transient Chore statusReporter;
+  transient Authenticator authenticator;
+  AtomicBoolean stopping = new AtomicBoolean(false);
+  boolean multiuser;
+  Map<String,Integer> maxAgeMap = 
+    Collections.synchronizedMap(new HashMap<String,Integer>());
+  List<Pair<String,Integer>> connectors = 
+    Collections.synchronizedList(new ArrayList<Pair<String,Integer>>());
+  StargateMetrics metrics = new StargateMetrics();
+
+  /**
+   * @return the RESTServlet singleton instance
+   * @throws IOException
+   */
+  public synchronized static RESTServlet getInstance() throws IOException {
+    if (instance == null) {
+      instance = new RESTServlet();
+    }
+    return instance;
+  }
+
+  static boolean ensureExists(final ZooKeeperWrapper zkw, final String znode,
+      final CreateMode mode) throws IOException {
+    ZooKeeper zk = zkw.getZooKeeper();
+    try {
+      Stat stat = zk.exists(znode, false);
+      if (stat != null) {
+        return true;
+      }
+      zk.create(znode, new byte[0], Ids.OPEN_ACL_UNSAFE, mode);
+      LOG.debug("Created ZNode " + znode);
+      return true;
+    } catch (KeeperException.NodeExistsException e) {
+      return true;      // ok, move on.
+    } catch (KeeperException.NoNodeException e) {
+      return ensureParentExists(zkw, znode, mode) && 
+        ensureExists(zkw, znode, mode);
+    } catch (KeeperException e) {
+      throw new IOException(e);
+    } catch (InterruptedException e) {
+      throw new IOException(e);
+    }
+  }
+
+  static boolean ensureParentExists(final ZooKeeperWrapper zkw,
+      final String znode, final CreateMode mode) throws IOException {
+    int index = znode.lastIndexOf("/");
+    if (index <= 0) {   // Parent is root, which always exists.
+      return true;
+    }
+    return ensureExists(zkw, znode.substring(0, index), mode);
+  }
+
+  static void updateNode(final ZooKeeperWrapper zkw, final String znode, 
+        final CreateMode mode, final byte[] data) throws IOException  {
+    ensureExists(zkw, znode, mode);
+    ZooKeeper zk = zkw.getZooKeeper();
+    try {
+      zk.setData(znode, data, -1);
+    } catch (KeeperException e) {
+      throw new IOException(e);
+    } catch (InterruptedException e) {
+      throw new IOException(e);
+    }
+  }
+
+  ZooKeeperWrapper initZooKeeperWrapper() throws IOException {
+    return new ZooKeeperWrapper(conf, this);
+  }
+
+  /**
+   * Constructor
+   * @throws IOException
+   */
+  public RESTServlet() throws IOException {
+    this.conf = HBaseConfiguration.create();
+    this.pool = new HTablePool(conf, 10);
+    this.wrapper = initZooKeeperWrapper();
+    this.statusReporter = new StatusReporter(
+      conf.getInt(STATUS_REPORT_PERIOD_KEY, 1000 * 60), stopping);
+    this.multiuser = conf.getBoolean("stargate.multiuser", false);
+  }
+
+  @Override
+  public void process(WatchedEvent event) {
+    LOG.debug(("ZooKeeper.Watcher event " + event.getType() + " with path " +
+      event.getPath()));
+    // handle disconnection (or manual delete to test disconnection scenario)
+    if (event.getState() == KeeperState.Expired || 
+        (event.getType().equals(EventType.NodeDeleted) && 
+            event.getPath().equals(znode))) {
+      wrapper.close();
+      wrapper = null;
+      while (!stopping.get()) try {
+        wrapper = initZooKeeperWrapper();
+        break;
+      } catch (IOException e) {
+        LOG.error(StringUtils.stringifyException(e));
+        try {
+          Thread.sleep(10 * 1000);
+        } catch (InterruptedException ex) {
+        }
+      }
+    }
+  }
+
+  HTablePool getTablePool() {
+    return pool;
+  }
+
+  ZooKeeperWrapper getZooKeeperWrapper() {
+    return wrapper;
+  }
+
+  Configuration getConfiguration() {
+    return conf;
+  }
+
+  StargateMetrics getMetrics() {
+    return metrics;
+  }
+
+  void addConnectorAddress(String host, int port) {
+    connectors.add(new Pair<String,Integer>(host, port));
+  }
+
+  /**
+   * @param tableName the table name
+   * @return the maximum cache age suitable for use with this table, in
+   *  seconds 
+   * @throws IOException
+   */
+  public int getMaxAge(String tableName) throws IOException {
+    Integer i = maxAgeMap.get(tableName);
+    if (i != null) {
+      return i.intValue();
+    }
+    HTableInterface table = pool.getTable(tableName);
+    try {
+      int maxAge = DEFAULT_MAX_AGE;
+      for (HColumnDescriptor family : 
+          table.getTableDescriptor().getFamilies()) {
+        int ttl = family.getTimeToLive();
+        if (ttl < 0) {
+          continue;
+        }
+        if (ttl < maxAge) {
+          maxAge = ttl;
+        }
+      }
+      maxAgeMap.put(tableName, maxAge);
+      return maxAge;
+    } finally {
+      pool.putTable(table);
+    }
+  }
+
+  /**
+   * Signal that a previously calculated maximum cache age has been
+   * invalidated by a schema change.
+   * @param tableName the table name
+   */
+  public void invalidateMaxAge(String tableName) {
+    maxAgeMap.remove(tableName);
+  }
+
+  /**
+   * @return true if the servlet should operate in multiuser mode
+   */
+  public boolean isMultiUser() {
+    return multiuser;
+  }
+
+  /**
+   * @param flag true if the servlet should operate in multiuser mode 
+   */
+  public void setMultiUser(boolean multiuser) {
+    this.multiuser = multiuser;
+  }
+
+  /**
+   * @return an authenticator
+   */
+  public Authenticator getAuthenticator() {
+    if (authenticator == null) {
+      String className = conf.get(AUTHENTICATOR_KEY,
+        HBCAuthenticator.class.getCanonicalName());
+      try {
+        Class<?> c = getClass().getClassLoader().loadClass(className);
+        if (className.endsWith(HBCAuthenticator.class.getName()) ||
+            className.endsWith(HTableAuthenticator.class.getName()) ||
+            className.endsWith(JDBCAuthenticator.class.getName())) {
+          Constructor<?> cons = c.getConstructor(Configuration.class);
+          authenticator = (Authenticator)
+            cons.newInstance(new Object[] { conf });
+        } else if (className.endsWith(ZooKeeperAuthenticator.class.getName())) {
+          Constructor<?> cons = c.getConstructor(Configuration.class,
+            ZooKeeperWrapper.class);
+          authenticator = (Authenticator)
+            cons.newInstance(new Object[] { conf, wrapper });
+        } else {
+          authenticator = (Authenticator)c.newInstance();
+        }
+      } catch (Exception e) {
+        LOG.error(StringUtils.stringifyException(e));
+      }
+      if (authenticator == null) {
+        authenticator = new HBCAuthenticator(conf);
+      }
+    }
+    return authenticator;
+  }
+
+  /**
+   * @param authenticator
+   */
+  public void setAuthenticator(Authenticator authenticator) {
+    this.authenticator = authenticator;
+  }
+
+  /**
+   * Check if the user has exceeded their request token limit within the
+   * current interval
+   * @param user the user
+   * @param want the number of tokens desired
+   * @throws IOException
+   */
+  public boolean userRequestLimit(final User user, int want) 
+      throws IOException {
+    UserData ud = SoftUserData.get(user);
+    HTableTokenBucket tb = (HTableTokenBucket) ud.get(UserData.TOKENBUCKET);
+    if (tb == null) {
+      tb = new HTableTokenBucket(conf, Bytes.toBytes(user.getToken()));
+      ud.put(UserData.TOKENBUCKET, tb);
+    }
+    if (tb.available() < want) {
+      return false;
+    }
+    tb.remove(want);
+    return true;
+  }
+
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RegionsResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RegionsResource.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RegionsResource.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RegionsResource.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.util.Map;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.CacheControl;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.core.Response.ResponseBuilder;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.HServerAddress;
+import org.apache.hadoop.hbase.TableNotFoundException;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.HTablePool;
+import org.apache.hadoop.hbase.stargate.User;
+import org.apache.hadoop.hbase.stargate.model.TableInfoModel;
+import org.apache.hadoop.hbase.stargate.model.TableRegionModel;
+
+public class RegionsResource implements Constants {
+  private static final Log LOG = LogFactory.getLog(RegionsResource.class);
+
+  User user;
+  String table;
+  CacheControl cacheControl;
+  RESTServlet servlet;
+
+  public RegionsResource(User user, String table) throws IOException {
+    if (user != null) {
+      if (!user.isAdmin()) {
+        throw new WebApplicationException(Response.Status.FORBIDDEN);
+      }
+      this.user = user;
+    }
+    this.table = table;
+    cacheControl = new CacheControl();
+    cacheControl.setNoCache(true);
+    cacheControl.setNoTransform(false);
+    servlet = RESTServlet.getInstance();
+  }
+
+  private Map<HRegionInfo,HServerAddress> getTableRegions()
+      throws IOException {
+    HTablePool pool = servlet.getTablePool();
+    HTable table = (HTable) pool.getTable(this.table);
+    try {
+      return table.getRegionsInfo();
+    } finally {
+      pool.putTable(table);
+    }
+  }
+
+  @GET
+  @Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
+  public Response get(final @Context UriInfo uriInfo) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("GET " + uriInfo.getAbsolutePath());
+    }
+    servlet.getMetrics().incrementRequests(1);
+    try {
+      TableInfoModel model = new TableInfoModel(table);
+      Map<HRegionInfo,HServerAddress> regions = getTableRegions();
+      for (Map.Entry<HRegionInfo,HServerAddress> e: regions.entrySet()) {
+        HRegionInfo hri = e.getKey();
+        HServerAddress addr = e.getValue();
+        InetSocketAddress sa = addr.getInetSocketAddress();
+        model.add(
+          new TableRegionModel(table, hri.getRegionId(), hri.getStartKey(),
+                hri.getEndKey(),
+                sa.getHostName() + ":" + Integer.valueOf(sa.getPort())));
+      }
+      ResponseBuilder response = Response.ok(model);
+      response.cacheControl(cacheControl);
+      return response.build();
+    } catch (TableNotFoundException e) {
+      throw new WebApplicationException(Response.Status.NOT_FOUND);
+    } catch (IOException e) {
+      throw new WebApplicationException(e,
+                  Response.Status.SERVICE_UNAVAILABLE);
+    }
+  }
+
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResourceConfig.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResourceConfig.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResourceConfig.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResourceConfig.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import com.sun.jersey.api.core.PackagesResourceConfig;
+
+public class ResourceConfig extends PackagesResourceConfig {
+  public ResourceConfig() {
+    super("org.apache.hadoop.hbase.stargate");
+  }
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResultGenerator.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResultGenerator.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResultGenerator.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/ResultGenerator.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import java.io.IOException;
+import java.util.Iterator;
+ 
+import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.filter.Filter;
+import org.apache.hadoop.hbase.stargate.model.ScannerModel;
+
+import org.json.JSONObject;
+
+public abstract class ResultGenerator implements Iterator<KeyValue> {
+
+  public static ResultGenerator fromRowSpec(final String table, 
+      final RowSpec rowspec, final Filter filter) throws IOException {
+    if (rowspec.isSingleRow()) {
+      return new RowResultGenerator(table, rowspec, filter);
+    } else {
+      return new ScannerResultGenerator(table, rowspec, filter);
+    }
+  }
+
+  public static Filter buildFilter(final String filter) throws Exception {
+    return ScannerModel.buildFilter(new JSONObject(filter));
+  }
+
+  public abstract void putBack(KeyValue kv);
+
+  public abstract void close();
+
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RootResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RootResource.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RootResource.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RootResource.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import java.io.IOException;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.CacheControl;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.core.Response.ResponseBuilder;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.stargate.User;
+import org.apache.hadoop.hbase.stargate.model.TableListModel;
+import org.apache.hadoop.hbase.stargate.model.TableModel;
+
+@Path("/")
+public class RootResource implements Constants {
+  private static final Log LOG = LogFactory.getLog(RootResource.class);
+
+  RESTServlet servlet;
+  CacheControl cacheControl;
+
+  public RootResource() throws IOException {
+    servlet = RESTServlet.getInstance();
+    cacheControl = new CacheControl();
+    cacheControl.setNoCache(true);
+    cacheControl.setNoTransform(false);
+  }
+
+  private final User auth(final String token) throws IOException {
+    User user = servlet.getAuthenticator().getUserForToken(token);
+    if (user == null || user.isDisabled()) {
+      throw new WebApplicationException(Response.Status.FORBIDDEN);
+    }
+    return user;
+  }
+
+  private final TableListModel getTableList() throws IOException {
+    TableListModel tableList = new TableListModel();
+    HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
+    HTableDescriptor[] list = admin.listTables();
+    for (HTableDescriptor htd: list) {
+      tableList.add(new TableModel(htd.getNameAsString()));
+    }
+    return tableList;
+  }
+
+  private final TableListModel getTableListForUser(final User user) 
+      throws IOException {
+    TableListModel tableList;
+    if (user.isAdmin()) {
+      tableList = getTableList();
+    } else {
+      tableList = new TableListModel();
+      HBaseAdmin admin = new HBaseAdmin(servlet.getConfiguration());
+      HTableDescriptor[] list = admin.listTables();
+      String prefix = user.getName() + ".";
+      for (HTableDescriptor htd: list) {
+        String name = htd.getNameAsString();
+        if (!name.startsWith(prefix)) {
+          continue;
+        }
+        tableList.add(new TableModel(name.substring(prefix.length())));
+      }
+    }
+    return tableList;
+  }
+
+  @GET
+  @Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
+  public Response get(final @Context UriInfo uriInfo) throws IOException {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("GET " + uriInfo.getAbsolutePath());
+    }
+    servlet.getMetrics().incrementRequests(1);
+    if (servlet.isMultiUser()) {
+      throw new WebApplicationException(Response.Status.BAD_REQUEST);
+    }
+    try {
+      ResponseBuilder response = Response.ok(getTableList());
+      response.cacheControl(cacheControl);
+      return response.build();
+    } catch (IOException e) {
+      throw new WebApplicationException(e, 
+                  Response.Status.SERVICE_UNAVAILABLE);
+    }
+  }
+
+  @Path("status/cluster")
+  public StorageClusterStatusResource getClusterStatusResource() 
+      throws IOException {
+    if (servlet.isMultiUser()) {
+      throw new WebApplicationException(Response.Status.BAD_REQUEST);
+    }
+    return new StorageClusterStatusResource();
+  }
+
+  @Path("version")
+  public VersionResource getVersionResource() throws IOException {
+    return new VersionResource();
+  }
+
+  @Path("{token: [0-9a-fA-F]{32} }") // 128 bit md5 sums
+  public Response getTableRootResource(
+      final @PathParam("token") String token) throws IOException {
+    if (servlet.isMultiUser()) {
+      User user = auth(token);
+      if (!servlet.userRequestLimit(user, 1)) {
+        throw new WebApplicationException(Response.status(509).build());
+      }
+      try {
+        ResponseBuilder response = Response.ok(getTableListForUser(user));
+        response.cacheControl(cacheControl);
+        return response.build();
+      } catch (IOException e) {
+        throw new WebApplicationException(e, 
+                    Response.Status.SERVICE_UNAVAILABLE);
+      }
+    }
+    throw new WebApplicationException(Response.Status.BAD_REQUEST);
+  }
+
+  @Path("{token: [0-9a-fA-F]{32} }/status/cluster") // 128 bit md5 sums
+  public StorageClusterStatusResource getClusterStatusResourceAuthorized(
+      final @PathParam("token") String token) throws IOException {
+    if (servlet.isMultiUser()) {
+      User user = auth(token);
+      if (user.isAdmin()) {
+        if (!servlet.userRequestLimit(user, 1)) {
+          throw new WebApplicationException(Response.status(509).build());
+        }
+        return new StorageClusterStatusResource();
+      }
+      throw new WebApplicationException(Response.Status.FORBIDDEN);
+    }
+    throw new WebApplicationException(Response.Status.BAD_REQUEST);
+  }
+
+  @Path("{token: [0-9a-fA-F]{32} }/{table}")
+  public TableResource getTableResource(
+      final @PathParam("token") String token, 
+      final @PathParam("table") String table) throws IOException {
+    if (servlet.isMultiUser()) {
+      User user = auth(token);
+      if (!servlet.userRequestLimit(user, 1)) {
+        throw new WebApplicationException(Response.status(509).build());
+      }
+      return new TableResource(user, table);
+    }
+    throw new WebApplicationException(Response.Status.BAD_REQUEST);
+  }
+
+  @Path("{table}")
+  public TableResource getTableResource(
+      final @PathParam("table") String table) throws IOException {
+    if (servlet.isMultiUser()) {
+      throw new WebApplicationException(Response.Status.BAD_REQUEST);
+    }
+    return new TableResource(null, table);
+  }
+
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResource.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResource.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResource.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,336 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import java.io.IOException;
+import java.net.URLDecoder;
+import java.util.List;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.CacheControl;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.core.Response.ResponseBuilder;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.client.Delete;
+import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.HTablePool;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.stargate.User;
+import org.apache.hadoop.hbase.stargate.model.CellModel;
+import org.apache.hadoop.hbase.stargate.model.CellSetModel;
+import org.apache.hadoop.hbase.stargate.model.RowModel;
+import org.apache.hadoop.hbase.util.Bytes;
+
+public class RowResource implements Constants {
+  private static final Log LOG = LogFactory.getLog(RowResource.class);
+
+  User user;
+  String tableName;
+  String actualTableName;
+  RowSpec rowspec;
+  CacheControl cacheControl;
+  RESTServlet servlet;
+
+  public RowResource(User user, String table, String rowspec, String versions)
+      throws IOException {
+    this.user = user;
+    if (user != null) {
+      this.actualTableName =
+        !user.isAdmin() ? user.getName() + "." + table : table;
+    } else {
+      this.actualTableName = table;
+    }
+    this.tableName = table;
+    this.rowspec = new RowSpec(URLDecoder.decode(rowspec,
+      HConstants.UTF8_ENCODING));
+    if (versions != null) {
+      this.rowspec.setMaxVersions(Integer.valueOf(versions));
+    }
+    this.servlet = RESTServlet.getInstance();
+    cacheControl = new CacheControl();
+    cacheControl.setMaxAge(servlet.getMaxAge(table));
+    cacheControl.setNoTransform(false);
+  }
+
+  @GET
+  @Produces({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
+  public Response get(final @Context UriInfo uriInfo) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("GET " + uriInfo.getAbsolutePath());
+    }
+    servlet.getMetrics().incrementRequests(1);
+    try {
+      ResultGenerator generator =
+        ResultGenerator.fromRowSpec(actualTableName, rowspec, null);
+      if (!generator.hasNext()) {
+        throw new WebApplicationException(Response.Status.NOT_FOUND);
+      }
+      CellSetModel model = new CellSetModel();
+      KeyValue value = generator.next();
+      byte[] rowKey = value.getRow();
+      RowModel rowModel = new RowModel(rowKey);
+      do {
+        if (!Bytes.equals(value.getRow(), rowKey)) {
+          model.addRow(rowModel);
+          rowKey = value.getRow();
+          rowModel = new RowModel(rowKey);
+        }
+        rowModel.addCell(
+          new CellModel(value.getFamily(), value.getQualifier(), 
+              value.getTimestamp(), value.getValue()));
+        value = generator.next();
+      } while (value != null);
+      model.addRow(rowModel);
+      ResponseBuilder response = Response.ok(model);
+      response.cacheControl(cacheControl);
+      return response.build();
+    } catch (IOException e) {
+      throw new WebApplicationException(e,
+                  Response.Status.SERVICE_UNAVAILABLE);
+    }
+  }
+
+  @GET
+  @Produces(MIMETYPE_BINARY)
+  public Response getBinary(final @Context UriInfo uriInfo) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("GET " + uriInfo.getAbsolutePath() + " as "+ MIMETYPE_BINARY);
+    }
+    servlet.getMetrics().incrementRequests(1);
+    // doesn't make sense to use a non specific coordinate as this can only
+    // return a single cell
+    if (!rowspec.hasColumns() || rowspec.getColumns().length > 1) {
+      throw new WebApplicationException(Response.Status.BAD_REQUEST);
+    }
+    try {
+      ResultGenerator generator =
+        ResultGenerator.fromRowSpec(actualTableName, rowspec, null);
+      if (!generator.hasNext()) {
+        throw new WebApplicationException(Response.Status.NOT_FOUND);
+      }
+      KeyValue value = generator.next();
+      ResponseBuilder response = Response.ok(value.getValue());
+      response.cacheControl(cacheControl);
+      response.header("X-Timestamp", value.getTimestamp());
+      return response.build();
+    } catch (IOException e) {
+      throw new WebApplicationException(e,
+                  Response.Status.SERVICE_UNAVAILABLE);
+    }
+  }
+
+  Response update(final CellSetModel model, final boolean replace) {
+    servlet.getMetrics().incrementRequests(1);
+    HTablePool pool = servlet.getTablePool();
+    HTableInterface table = null;
+    try {
+      List<RowModel> rows = model.getRows();
+      // the user request limit is a transaction limit, so we need to
+      // account for updates by row
+      if (user != null && !servlet.userRequestLimit(user, rows.size())) {
+        throw new WebApplicationException(Response.status(509).build());
+      }
+      table = pool.getTable(actualTableName);
+      for (RowModel row: rows) {
+        byte[] key = row.getKey();
+        Put put = new Put(key);
+        for (CellModel cell: row.getCells()) {
+          byte [][] parts = KeyValue.parseColumn(cell.getColumn());
+          if (parts.length == 2 && parts[1].length > 0) {
+            put.add(parts[0], parts[1], cell.getTimestamp(), cell.getValue());
+          } else {
+            put.add(parts[0], null, cell.getTimestamp(), cell.getValue());
+          }
+        }
+        table.put(put);
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("PUT " + put.toString());
+        }
+      }
+      table.flushCommits();
+      ResponseBuilder response = Response.ok();
+      return response.build();
+    } catch (IOException e) {
+      throw new WebApplicationException(e,
+                  Response.Status.SERVICE_UNAVAILABLE);
+    } finally {
+      if (table != null) {
+        pool.putTable(table);
+      }
+    }
+  }
+
+  // This currently supports only update of one row at a time.
+  Response updateBinary(final byte[] message, final HttpHeaders headers,
+      final boolean replace) {
+    servlet.getMetrics().incrementRequests(1);
+    HTablePool pool = servlet.getTablePool();
+    HTableInterface table = null;    
+    try {
+      byte[] row = rowspec.getRow();
+      byte[][] columns = rowspec.getColumns();
+      byte[] column = null;
+      if (columns != null) {
+        column = columns[0];
+      }
+      long timestamp = HConstants.LATEST_TIMESTAMP;
+      List<String> vals = headers.getRequestHeader("X-Row");
+      if (vals != null && !vals.isEmpty()) {
+        row = Bytes.toBytes(vals.get(0));
+      }
+      vals = headers.getRequestHeader("X-Column");
+      if (vals != null && !vals.isEmpty()) {
+        column = Bytes.toBytes(vals.get(0));
+      }
+      vals = headers.getRequestHeader("X-Timestamp");
+      if (vals != null && !vals.isEmpty()) {
+        timestamp = Long.valueOf(vals.get(0));
+      }
+      if (column == null) {
+        throw new WebApplicationException(Response.Status.BAD_REQUEST);
+      }
+      Put put = new Put(row);
+      byte parts[][] = KeyValue.parseColumn(column);
+      if (parts.length == 2 && parts[1].length > 0) {
+        put.add(parts[0], parts[1], timestamp, message);
+      } else {
+        put.add(parts[0], null, timestamp, message);
+      }
+      table = pool.getTable(actualTableName);
+      table.put(put);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("PUT " + put.toString());
+      }
+      table.flushCommits();
+      return Response.ok().build();
+    } catch (IOException e) {
+      throw new WebApplicationException(e,
+                  Response.Status.SERVICE_UNAVAILABLE);
+    } finally {
+      if (table != null) {
+        pool.putTable(table);
+      }
+    }
+  }
+
+  @PUT
+  @Consumes({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
+  public Response put(final CellSetModel model,
+      final @Context UriInfo uriInfo) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("PUT " + uriInfo.getAbsolutePath());
+    }
+    return update(model, true);
+  }
+
+  @PUT
+  @Consumes(MIMETYPE_BINARY)
+  public Response putBinary(final byte[] message,
+      final @Context UriInfo uriInfo, final @Context HttpHeaders headers)
+  {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("PUT " + uriInfo.getAbsolutePath() + " as "+ MIMETYPE_BINARY);
+    }
+    return updateBinary(message, headers, true);
+  }
+
+  @POST
+  @Consumes({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
+  public Response post(final CellSetModel model,
+      final @Context UriInfo uriInfo) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("POST " + uriInfo.getAbsolutePath());
+    }
+    return update(model, false);
+  }
+
+  @POST
+  @Consumes(MIMETYPE_BINARY)
+  public Response postBinary(final byte[] message,
+      final @Context UriInfo uriInfo, final @Context HttpHeaders headers) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("POST " + uriInfo.getAbsolutePath() + " as "+MIMETYPE_BINARY);
+    }
+    return updateBinary(message, headers, false);
+  }
+
+  @DELETE
+  public Response delete(final @Context UriInfo uriInfo) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("DELETE " + uriInfo.getAbsolutePath());
+    }
+    servlet.getMetrics().incrementRequests(1);
+    Delete delete = null;
+    if (rowspec.hasTimestamp())
+      delete = new Delete(rowspec.getRow(), rowspec.getTimestamp(), null);
+    else
+      delete = new Delete(rowspec.getRow());
+
+    for (byte[] column: rowspec.getColumns()) {
+      byte[][] split = KeyValue.parseColumn(column);
+      if (rowspec.hasTimestamp()) {
+        if (split.length == 2 && split[1].length != 0) {
+          delete.deleteColumns(split[0], split[1], rowspec.getTimestamp());
+        } else {
+          delete.deleteFamily(split[0], rowspec.getTimestamp());
+        }
+      } else {
+        if (split.length == 2 && split[1].length != 0) {
+          delete.deleteColumns(split[0], split[1]);
+        } else {
+          delete.deleteFamily(split[0]);
+        }
+      }
+    }
+    HTablePool pool = servlet.getTablePool();
+    HTableInterface table = null;
+    try {
+      table = pool.getTable(actualTableName);
+      table.delete(delete);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("DELETE " + delete.toString());
+      }
+      table.flushCommits();
+    } catch (IOException e) {
+      throw new WebApplicationException(e, 
+                  Response.Status.SERVICE_UNAVAILABLE);
+    } finally {
+      if (table != null) {
+        pool.putTable(table);
+      }
+    }
+    return Response.ok().build();
+  }
+
+}

Added: hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResultGenerator.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResultGenerator.java?rev=928876&view=auto
==============================================================================
--- hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResultGenerator.java (added)
+++ hadoop/hbase/trunk/contrib/stargate/core/src/main/java/org/apache/hadoop/hbase/stargate/RowResultGenerator.java Mon Mar 29 19:15:15 2010
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2010 The Apache Software Foundation
+ *
+ * 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.hadoop.hbase.stargate;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import org.apache.hadoop.hbase.HColumnDescriptor;
+import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.client.Get;
+import org.apache.hadoop.hbase.client.HTableInterface;
+import org.apache.hadoop.hbase.client.HTablePool;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.filter.Filter;
+
+public class RowResultGenerator extends ResultGenerator {
+  private Iterator<KeyValue> valuesI;
+  private KeyValue cache;
+
+  public RowResultGenerator(final String tableName, final RowSpec rowspec,
+      final Filter filter) throws IllegalArgumentException, IOException {
+    HTablePool pool = RESTServlet.getInstance().getTablePool(); 
+    HTableInterface table = pool.getTable(tableName);
+    try {
+      Get get = new Get(rowspec.getRow());
+      if (rowspec.hasColumns()) {
+        for (byte[] col: rowspec.getColumns()) {
+          byte[][] split = KeyValue.parseColumn(col);
+          if (split.length == 2 && split[1].length != 0) {
+            get.addColumn(split[0], split[1]);
+          } else {
+            get.addFamily(split[0]);
+          }
+        }
+      } else {
+        // rowspec does not explicitly specify columns, return them all
+        for (HColumnDescriptor family: 
+            table.getTableDescriptor().getFamilies()) {
+          get.addFamily(family.getName());
+        }
+      }
+      get.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime());
+      get.setMaxVersions(rowspec.getMaxVersions());
+      if (filter != null) {
+        get.setFilter(filter);
+      }
+      Result result = table.get(get);
+      if (result != null && !result.isEmpty()) {
+        valuesI = result.list().iterator();
+      }
+    } finally {
+      pool.putTable(table);
+    }
+  }
+
+  public void close() {
+  }
+
+  public boolean hasNext() {
+    if (cache != null) {
+      return true;
+    }
+    if (valuesI == null) {
+      return false;
+    }
+    return valuesI.hasNext();
+  }
+
+  public KeyValue next() {
+    if (cache != null) {
+      KeyValue kv = cache;
+      cache = null;
+      return kv;
+    }
+    if (valuesI == null) {
+      return null;
+    }
+    try {
+      return valuesI.next();
+    } catch (NoSuchElementException e) {
+      return null;
+    }
+  }
+
+  public void putBack(KeyValue kv) {
+    this.cache = kv;
+  }
+
+  public void remove() {
+    throw new UnsupportedOperationException("remove not supported");
+  }
+
+}



Mime
View raw message