├── .gitignore ├── KEYS ├── LICENSE ├── NOTICE ├── README.md ├── bin ├── daemon.py ├── end2endTest.py ├── hadoop-metrics2-hbase.properties ├── hadoop-metrics2-phoenix.properties ├── hbase-site.xml ├── log4j.properties ├── performance.py ├── phoenix_sandbox.py ├── phoenix_utils.py ├── psql.py ├── queryserver.py ├── readme.txt ├── sandbox-log4j.properties ├── sqlline-thin.py ├── sqlline.py └── traceserver.py ├── build.txt ├── config ├── apache-access-logs.properties └── csv-bulk-load-config.properties ├── dev ├── PhoenixCodeTemplate.xml ├── eclipse_prefs_phoenix.epf ├── jenkinsEnv.sh ├── make_rc.sh ├── phoenix.importorder ├── release_files │ ├── LICENSE │ └── NOTICE ├── smart-apply-patch.sh ├── test-patch.properties └── test-patch.sh ├── docs └── phoenix.csv ├── examples ├── STOCK_SYMBOL.csv ├── STOCK_SYMBOL.sql ├── WEB_STAT.csv ├── WEB_STAT.sql ├── WEB_STAT_QUERIES.sql └── pig │ ├── test.pig │ └── testdata ├── phoenix-assembly ├── pom.xml └── src │ └── build │ ├── client-minimal.xml │ ├── client-without-hbase.xml │ ├── client.xml │ ├── components-major-client.xml │ ├── components-minimal.xml │ ├── components │ ├── all-common-dependencies.xml │ ├── all-common-files.xml │ └── all-common-jars.xml │ ├── package-to-tar-all.xml │ ├── server-without-antlr.xml │ ├── server.xml │ └── src.xml ├── phoenix-core ├── pom.xml └── src │ ├── build │ └── phoenix-core.xml │ ├── it │ ├── java │ │ └── org │ │ │ └── apache │ │ │ ├── hadoop │ │ │ └── hbase │ │ │ │ └── regionserver │ │ │ │ └── wal │ │ │ │ ├── ReadWriteKeyValuesWithCodecIT.java │ │ │ │ ├── WALReplayWithIndexWritesAndCompressedWALIT.java │ │ │ │ └── WALReplayWithIndexWritesAndUncompressedWALInHBase_094_9_IT.java │ │ │ └── phoenix │ │ │ ├── Sandbox.java │ │ │ ├── end2end │ │ │ ├── AbsFunctionEnd2EndIT.java │ │ │ ├── AggregateQueryIT.java │ │ │ ├── AlterSessionIT.java │ │ │ ├── AlterTableIT.java │ │ │ ├── AlterTableWithViewsIT.java │ │ │ ├── ArithmeticQueryIT.java │ │ │ ├── ArrayAppendFunctionIT.java │ │ │ ├── ArrayConcatFunctionIT.java │ │ │ ├── ArrayFillFunctionIT.java │ │ │ ├── ArrayIT.java │ │ │ ├── ArrayPrependFunctionIT.java │ │ │ ├── ArrayToStringFunctionIT.java │ │ │ ├── ArraysWithNullsIT.java │ │ │ ├── AutoCommitIT.java │ │ │ ├── BaseClientManagedTimeIT.java │ │ │ ├── BaseHBaseManagedTimeIT.java │ │ │ ├── BaseOwnClusterClientManagedTimeIT.java │ │ │ ├── BaseOwnClusterHBaseManagedTimeIT.java │ │ │ ├── BaseOwnClusterIT.java │ │ │ ├── BaseQueryIT.java │ │ │ ├── BaseTenantSpecificTablesIT.java │ │ │ ├── BaseTenantSpecificViewIndexIT.java │ │ │ ├── BaseViewIT.java │ │ │ ├── BinaryRowKeyIT.java │ │ │ ├── CSVCommonsLoaderIT.java │ │ │ ├── CaseStatementIT.java │ │ │ ├── CastAndCoerceIT.java │ │ │ ├── CbrtFunctionEnd2EndIT.java │ │ │ ├── ClientManagedTimeTest.java │ │ │ ├── ClientTimeArithmeticQueryIT.java │ │ │ ├── CoalesceFunctionIT.java │ │ │ ├── ColumnProjectionOptimizationIT.java │ │ │ ├── CompareDecimalToLongIT.java │ │ │ ├── ConnectionQueryServicesTestImpl.java │ │ │ ├── ContextClassloaderIT.java │ │ │ ├── ConvertTimezoneFunctionIT.java │ │ │ ├── CountDistinctCompressionIT.java │ │ │ ├── CreateTableIT.java │ │ │ ├── CustomEntityDataIT.java │ │ │ ├── DateTimeIT.java │ │ │ ├── DecodeFunctionIT.java │ │ │ ├── DeleteIT.java │ │ │ ├── DerivedTableIT.java │ │ │ ├── DisableLocalIndexIT.java │ │ │ ├── DistinctCountIT.java │ │ │ ├── DynamicColumnIT.java │ │ │ ├── DynamicFamilyIT.java │ │ │ ├── DynamicUpsertIT.java │ │ │ ├── EncodeFunctionIT.java │ │ │ ├── End2EndTestDriver.java │ │ │ ├── EvaluationOfORIT.java │ │ │ ├── ExecuteStatementsIT.java │ │ │ ├── ExpFunctionEnd2EndIT.java │ │ │ ├── ExtendedQueryExecIT.java │ │ │ ├── FirstValueFunctionIT.java │ │ │ ├── FunkyNamesIT.java │ │ │ ├── GetSetByteBitFunctionEnd2EndIT.java │ │ │ ├── GroupByCaseIT.java │ │ │ ├── GroupByIT.java │ │ │ ├── HBaseManagedTimeTest.java │ │ │ ├── HashJoinIT.java │ │ │ ├── HashJoinLocalIndexIT.java │ │ │ ├── InListIT.java │ │ │ ├── InMemoryOrderByIT.java │ │ │ ├── InstrFunctionIT.java │ │ │ ├── IsNullIT.java │ │ │ ├── KeyOnlyIT.java │ │ │ ├── LastValueFunctionIT.java │ │ │ ├── LikeExpressionIT.java │ │ │ ├── LnLogFunctionEnd2EndIT.java │ │ │ ├── LpadFunctionIT.java │ │ │ ├── MD5FunctionIT.java │ │ │ ├── MappingTableDataTypeIT.java │ │ │ ├── MinMaxAggregateFunctionIT.java │ │ │ ├── ModulusExpressionIT.java │ │ │ ├── MultiCfQueryExecIT.java │ │ │ ├── NativeHBaseTypesIT.java │ │ │ ├── NeedsOwnMiniClusterTest.java │ │ │ ├── NotQueryIT.java │ │ │ ├── NthValueFunctionIT.java │ │ │ ├── OctetLengthFunctionEnd2EndIT.java │ │ │ ├── OrderByIT.java │ │ │ ├── ParallelIteratorsIT.java │ │ │ ├── PercentileIT.java │ │ │ ├── PhoenixRuntimeIT.java │ │ │ ├── PointInTimeQueryIT.java │ │ │ ├── PowerFunctionEnd2EndIT.java │ │ │ ├── ProductMetricsIT.java │ │ │ ├── QueryDatabaseMetaDataIT.java │ │ │ ├── QueryExecWithoutSCNIT.java │ │ │ ├── QueryIT.java │ │ │ ├── QueryMoreIT.java │ │ │ ├── QueryTimeoutIT.java │ │ │ ├── QueryWithLimitIT.java │ │ │ ├── RTrimFunctionIT.java │ │ │ ├── ReadIsolationLevelIT.java │ │ │ ├── ReadOnlyIT.java │ │ │ ├── RegexpReplaceFunctionIT.java │ │ │ ├── RegexpSplitFunctionIT.java │ │ │ ├── RegexpSubstrFunctionIT.java │ │ │ ├── ReverseFunctionIT.java │ │ │ ├── ReverseScanIT.java │ │ │ ├── RoundFloorCeilFunctionsEnd2EndIT.java │ │ │ ├── RowValueConstructorIT.java │ │ │ ├── SaltedViewIT.java │ │ │ ├── ScanQueryIT.java │ │ │ ├── SequenceBulkAllocationIT.java │ │ │ ├── SequenceIT.java │ │ │ ├── ServerExceptionIT.java │ │ │ ├── Shadower.java │ │ │ ├── SignFunctionEnd2EndIT.java │ │ │ ├── SkipScanAfterManualSplitIT.java │ │ │ ├── SkipScanQueryIT.java │ │ │ ├── SortMergeJoinIT.java │ │ │ ├── SortOrderIT.java │ │ │ ├── SpillableGroupByIT.java │ │ │ ├── SpooledOrderByIT.java │ │ │ ├── SpooledSortMergeJoinIT.java │ │ │ ├── SpooledTmpFileDeleteIT.java │ │ │ ├── SqrtFunctionEnd2EndIT.java │ │ │ ├── StatementHintsIT.java │ │ │ ├── StatsCollectorAbstractIT.java │ │ │ ├── StatsCollectorIT.java │ │ │ ├── StatsCollectorWithSplitsAndMultiCFIT.java │ │ │ ├── StddevIT.java │ │ │ ├── StoreNullsIT.java │ │ │ ├── StringToArrayFunctionIT.java │ │ │ ├── SubqueryIT.java │ │ │ ├── SubqueryUsingSortMergeJoinIT.java │ │ │ ├── TenantIdTypeIT.java │ │ │ ├── TenantSpecificTablesDDLIT.java │ │ │ ├── TenantSpecificTablesDMLIT.java │ │ │ ├── TenantSpecificViewIndexIT.java │ │ │ ├── TenantSpecificViewIndexSaltedIT.java │ │ │ ├── TimezoneOffsetFunctionIT.java │ │ │ ├── ToCharFunctionIT.java │ │ │ ├── ToDateFunctionIT.java │ │ │ ├── ToNumberFunctionIT.java │ │ │ ├── TopNIT.java │ │ │ ├── TruncateFunctionIT.java │ │ │ ├── UnionAllIT.java │ │ │ ├── UnnestArrayIT.java │ │ │ ├── UpgradeIT.java │ │ │ ├── UpsertBigValuesIT.java │ │ │ ├── UpsertSelectAutoCommitIT.java │ │ │ ├── UpsertSelectIT.java │ │ │ ├── UpsertValuesIT.java │ │ │ ├── UserDefinedFunctionsIT.java │ │ │ ├── VariableLengthPKIT.java │ │ │ ├── ViewIT.java │ │ │ ├── index │ │ │ │ ├── BaseMutableIndexIT.java │ │ │ │ ├── DropIndexDuringUpsertIT.java │ │ │ │ ├── DropViewIT.java │ │ │ │ ├── GlobalIndexOptimizationIT.java │ │ │ │ ├── GlobalMutableIndexIT.java │ │ │ │ ├── ImmutableIndexIT.java │ │ │ │ ├── ImmutableIndexWithStatsIT.java │ │ │ │ ├── IndexExpressionIT.java │ │ │ │ ├── IndexHandlerIT.java │ │ │ │ ├── IndexMetadataIT.java │ │ │ │ ├── IndexTestUtil.java │ │ │ │ ├── LocalIndexIT.java │ │ │ │ ├── LocalMutableIndexIT.java │ │ │ │ ├── MutableIndexFailureIT.java │ │ │ │ ├── MutableIndexReplicationIT.java │ │ │ │ ├── SaltedIndexIT.java │ │ │ │ └── ViewIndexIT.java │ │ │ └── salted │ │ │ │ ├── SaltedTableIT.java │ │ │ │ ├── SaltedTableUpsertSelectIT.java │ │ │ │ └── SaltedTableVarLengthRowKeyIT.java │ │ │ ├── execute │ │ │ └── PartialCommitIT.java │ │ │ ├── hbase │ │ │ └── index │ │ │ │ ├── FailForUnsupportedHBaseVersionsIT.java │ │ │ │ ├── balancer │ │ │ │ └── IndexLoadBalancerIT.java │ │ │ │ └── covered │ │ │ │ ├── EndToEndCoveredColumnsIndexBuilderIT.java │ │ │ │ └── example │ │ │ │ ├── EndToEndCoveredIndexingIT.java │ │ │ │ ├── EndtoEndIndexingWithCompressionIT.java │ │ │ │ └── FailWithoutRetriesIT.java │ │ │ ├── iterate │ │ │ ├── MockParallelIteratorFactory.java │ │ │ ├── MockTableResultIterator.java │ │ │ ├── PhoenixQueryTimeoutIT.java │ │ │ ├── RoundRobinResultIteratorIT.java │ │ │ └── RoundRobinResultIteratorWithStatsIT.java │ │ │ ├── mapreduce │ │ │ ├── CsvBulkLoadToolIT.java │ │ │ └── IndexToolIT.java │ │ │ ├── monitoring │ │ │ └── PhoenixMetricsIT.java │ │ │ ├── rpc │ │ │ ├── PhoenixClientRpcIT.java │ │ │ ├── PhoenixServerRpcIT.java │ │ │ ├── TestPhoenixIndexRpcSchedulerFactory.java │ │ │ └── UpdateCacheIT.java │ │ │ └── trace │ │ │ ├── BaseTracingTestIT.java │ │ │ ├── DelegatingConnection.java │ │ │ ├── DisableableMetricsWriter.java │ │ │ ├── PhoenixTableMetricsWriterIT.java │ │ │ ├── PhoenixTagImpl.java │ │ │ ├── PhoenixTraceReaderIT.java │ │ │ ├── PhoenixTracingEndToEndIT.java │ │ │ └── TracingTestUtil.java │ └── resources │ │ ├── hbase-site.xml │ │ └── log4j.properties │ ├── main │ ├── antlr3 │ │ └── PhoenixSQL.g │ ├── java │ │ ├── org │ │ │ └── apache │ │ │ │ ├── hadoop │ │ │ │ └── hbase │ │ │ │ │ ├── ipc │ │ │ │ │ ├── PhoenixRpcScheduler.java │ │ │ │ │ ├── PhoenixRpcSchedulerFactory.java │ │ │ │ │ └── controller │ │ │ │ │ │ ├── ClientRpcControllerFactory.java │ │ │ │ │ │ ├── IndexRpcController.java │ │ │ │ │ │ ├── MetadataRpcController.java │ │ │ │ │ │ └── ServerRpcControllerFactory.java │ │ │ │ │ └── regionserver │ │ │ │ │ ├── IndexHalfStoreFileReader.java │ │ │ │ │ ├── IndexHalfStoreFileReaderGenerator.java │ │ │ │ │ ├── IndexKeyValueSkipListSet.java │ │ │ │ │ ├── IndexSplitTransaction.java │ │ │ │ │ ├── KeyValueSkipListSet.java │ │ │ │ │ ├── LocalIndexMerger.java │ │ │ │ │ ├── LocalIndexSplitter.java │ │ │ │ │ └── wal │ │ │ │ │ ├── IndexedHLogReader.java │ │ │ │ │ └── IndexedWALEditCodec.java │ │ │ │ └── phoenix │ │ │ │ ├── cache │ │ │ │ ├── GlobalCache.java │ │ │ │ ├── HashCache.java │ │ │ │ ├── IndexMetaDataCache.java │ │ │ │ ├── JodaTimezoneCache.java │ │ │ │ ├── ServerCacheClient.java │ │ │ │ ├── TenantCache.java │ │ │ │ ├── TenantCacheImpl.java │ │ │ │ └── aggcache │ │ │ │ │ ├── SpillFile.java │ │ │ │ │ ├── SpillManager.java │ │ │ │ │ ├── SpillMap.java │ │ │ │ │ └── SpillableGroupByCache.java │ │ │ │ ├── call │ │ │ │ ├── CallRunner.java │ │ │ │ └── CallWrapper.java │ │ │ │ ├── compile │ │ │ │ ├── AggregationManager.java │ │ │ │ ├── BindManager.java │ │ │ │ ├── ColumnProjector.java │ │ │ │ ├── ColumnResolver.java │ │ │ │ ├── CreateFunctionCompiler.java │ │ │ │ ├── CreateIndexCompiler.java │ │ │ │ ├── CreateSequenceCompiler.java │ │ │ │ ├── CreateTableCompiler.java │ │ │ │ ├── DeleteCompiler.java │ │ │ │ ├── DropSequenceCompiler.java │ │ │ │ ├── ExplainPlan.java │ │ │ │ ├── ExpressionCompiler.java │ │ │ │ ├── ExpressionManager.java │ │ │ │ ├── ExpressionProjector.java │ │ │ │ ├── FromCompiler.java │ │ │ │ ├── GroupByCompiler.java │ │ │ │ ├── HavingCompiler.java │ │ │ │ ├── IndexExpressionCompiler.java │ │ │ │ ├── IndexStatementRewriter.java │ │ │ │ ├── JoinCompiler.java │ │ │ │ ├── KeyPart.java │ │ │ │ ├── LimitCompiler.java │ │ │ │ ├── ListJarsQueryPlan.java │ │ │ │ ├── MutatingParallelIteratorFactory.java │ │ │ │ ├── MutationPlan.java │ │ │ │ ├── OrderByCompiler.java │ │ │ │ ├── OrderPreservingTracker.java │ │ │ │ ├── PostDDLCompiler.java │ │ │ │ ├── PostIndexDDLCompiler.java │ │ │ │ ├── ProjectionCompiler.java │ │ │ │ ├── QueryCompiler.java │ │ │ │ ├── QueryPlan.java │ │ │ │ ├── RowProjector.java │ │ │ │ ├── ScanRanges.java │ │ │ │ ├── SequenceManager.java │ │ │ │ ├── SequenceValueExpression.java │ │ │ │ ├── StatementContext.java │ │ │ │ ├── StatementNormalizer.java │ │ │ │ ├── StatementPlan.java │ │ │ │ ├── SubqueryRewriter.java │ │ │ │ ├── SubselectRewriter.java │ │ │ │ ├── TraceQueryPlan.java │ │ │ │ ├── TupleProjectionCompiler.java │ │ │ │ ├── UnionCompiler.java │ │ │ │ ├── UpsertCompiler.java │ │ │ │ ├── WhereCompiler.java │ │ │ │ └── WhereOptimizer.java │ │ │ │ ├── coprocessor │ │ │ │ ├── BaseRegionScanner.java │ │ │ │ ├── BaseScannerRegionObserver.java │ │ │ │ ├── DelegateRegionScanner.java │ │ │ │ ├── GroupByCache.java │ │ │ │ ├── GroupedAggregateRegionObserver.java │ │ │ │ ├── HashJoinRegionScanner.java │ │ │ │ ├── MetaDataEndpointImpl.java │ │ │ │ ├── MetaDataProtocol.java │ │ │ │ ├── MetaDataRegionObserver.java │ │ │ │ ├── ScanRegionObserver.java │ │ │ │ ├── SequenceRegionObserver.java │ │ │ │ ├── ServerCachingEndpointImpl.java │ │ │ │ ├── ServerCachingProtocol.java │ │ │ │ ├── SuffixFilter.java │ │ │ │ ├── UngroupedAggregateRegionObserver.java │ │ │ │ └── generated │ │ │ │ │ ├── MetaDataProtos.java │ │ │ │ │ ├── PFunctionProtos.java │ │ │ │ │ ├── PGuidePostsProtos.java │ │ │ │ │ ├── PTableProtos.java │ │ │ │ │ ├── ServerCacheFactoryProtos.java │ │ │ │ │ ├── ServerCachingProtos.java │ │ │ │ │ └── StatCollectorProtos.java │ │ │ │ ├── exception │ │ │ │ ├── BatchUpdateExecution.java │ │ │ │ ├── DataExceedsCapacityException.java │ │ │ │ ├── PhoenixIOException.java │ │ │ │ ├── PhoenixParserException.java │ │ │ │ ├── SQLExceptionCode.java │ │ │ │ ├── SQLExceptionInfo.java │ │ │ │ ├── UndecodableByteException.java │ │ │ │ └── UnknownFunctionException.java │ │ │ │ ├── execute │ │ │ │ ├── AggregatePlan.java │ │ │ │ ├── BaseQueryPlan.java │ │ │ │ ├── ClientAggregatePlan.java │ │ │ │ ├── ClientProcessingPlan.java │ │ │ │ ├── ClientScanPlan.java │ │ │ │ ├── CommitException.java │ │ │ │ ├── CorrelatePlan.java │ │ │ │ ├── DegenerateQueryPlan.java │ │ │ │ ├── DelegateQueryPlan.java │ │ │ │ ├── DescVarLengthFastByteComparisons.java │ │ │ │ ├── HashJoinPlan.java │ │ │ │ ├── LiteralResultIterationPlan.java │ │ │ │ ├── MutationState.java │ │ │ │ ├── RuntimeContext.java │ │ │ │ ├── RuntimeContextImpl.java │ │ │ │ ├── ScanPlan.java │ │ │ │ ├── SortMergeJoinPlan.java │ │ │ │ ├── TupleProjectionPlan.java │ │ │ │ ├── TupleProjector.java │ │ │ │ ├── UnionPlan.java │ │ │ │ └── UnnestArrayPlan.java │ │ │ │ ├── expression │ │ │ │ ├── AddExpression.java │ │ │ │ ├── AndExpression.java │ │ │ │ ├── AndOrExpression.java │ │ │ │ ├── ArithmeticExpression.java │ │ │ │ ├── ArrayConstructorExpression.java │ │ │ │ ├── BaseAddSubtractExpression.java │ │ │ │ ├── BaseCompoundExpression.java │ │ │ │ ├── BaseDecimalAddSubtractExpression.java │ │ │ │ ├── BaseExpression.java │ │ │ │ ├── BaseSingleExpression.java │ │ │ │ ├── BaseTerminalExpression.java │ │ │ │ ├── ByteBasedLikeExpression.java │ │ │ │ ├── CaseExpression.java │ │ │ │ ├── CoerceExpression.java │ │ │ │ ├── ColumnExpression.java │ │ │ │ ├── ComparisonExpression.java │ │ │ │ ├── CorrelateVariableFieldAccessExpression.java │ │ │ │ ├── CurrentDateTimeFunction.java │ │ │ │ ├── DateAddExpression.java │ │ │ │ ├── DateSubtractExpression.java │ │ │ │ ├── DecimalAddExpression.java │ │ │ │ ├── DecimalDivideExpression.java │ │ │ │ ├── DecimalMultiplyExpression.java │ │ │ │ ├── DecimalSubtractExpression.java │ │ │ │ ├── DelegateExpression.java │ │ │ │ ├── Determinism.java │ │ │ │ ├── DivideExpression.java │ │ │ │ ├── DoubleAddExpression.java │ │ │ │ ├── DoubleDivideExpression.java │ │ │ │ ├── DoubleMultiplyExpression.java │ │ │ │ ├── DoubleSubtractExpression.java │ │ │ │ ├── Expression.java │ │ │ │ ├── ExpressionType.java │ │ │ │ ├── InListExpression.java │ │ │ │ ├── IsNullExpression.java │ │ │ │ ├── KeyValueColumnExpression.java │ │ │ │ ├── LikeExpression.java │ │ │ │ ├── LiteralExpression.java │ │ │ │ ├── LongAddExpression.java │ │ │ │ ├── LongDivideExpression.java │ │ │ │ ├── LongMultiplyExpression.java │ │ │ │ ├── LongSubtractExpression.java │ │ │ │ ├── ModulusExpression.java │ │ │ │ ├── MultiplyExpression.java │ │ │ │ ├── NotExpression.java │ │ │ │ ├── OrExpression.java │ │ │ │ ├── OrderByExpression.java │ │ │ │ ├── ProjectedColumnExpression.java │ │ │ │ ├── RowKeyColumnExpression.java │ │ │ │ ├── RowKeyExpression.java │ │ │ │ ├── RowValueConstructorExpression.java │ │ │ │ ├── StringBasedLikeExpression.java │ │ │ │ ├── StringConcatExpression.java │ │ │ │ ├── SubtractExpression.java │ │ │ │ ├── TimestampAddExpression.java │ │ │ │ ├── TimestampSubtractExpression.java │ │ │ │ ├── aggregator │ │ │ │ │ ├── Aggregator.java │ │ │ │ │ ├── Aggregators.java │ │ │ │ │ ├── BaseAggregator.java │ │ │ │ │ ├── BaseDecimalStddevAggregator.java │ │ │ │ │ ├── BaseStddevAggregator.java │ │ │ │ │ ├── ClientAggregators.java │ │ │ │ │ ├── CountAggregator.java │ │ │ │ │ ├── DecimalStddevPopAggregator.java │ │ │ │ │ ├── DecimalStddevSampAggregator.java │ │ │ │ │ ├── DecimalSumAggregator.java │ │ │ │ │ ├── DistinctCountClientAggregator.java │ │ │ │ │ ├── DistinctValueClientAggregator.java │ │ │ │ │ ├── DistinctValueWithCountClientAggregator.java │ │ │ │ │ ├── DistinctValueWithCountServerAggregator.java │ │ │ │ │ ├── DoubleSumAggregator.java │ │ │ │ │ ├── FirstLastValueBaseClientAggregator.java │ │ │ │ │ ├── FirstLastValueServerAggregator.java │ │ │ │ │ ├── IntSumAggregator.java │ │ │ │ │ ├── LongSumAggregator.java │ │ │ │ │ ├── MaxAggregator.java │ │ │ │ │ ├── MinAggregator.java │ │ │ │ │ ├── NumberSumAggregator.java │ │ │ │ │ ├── PercentRankClientAggregator.java │ │ │ │ │ ├── PercentileClientAggregator.java │ │ │ │ │ ├── PercentileDiscClientAggregator.java │ │ │ │ │ ├── ServerAggregators.java │ │ │ │ │ ├── StddevPopAggregator.java │ │ │ │ │ ├── StddevSampAggregator.java │ │ │ │ │ ├── UnsignedIntSumAggregator.java │ │ │ │ │ └── UnsignedLongSumAggregator.java │ │ │ │ ├── function │ │ │ │ │ ├── AbsFunction.java │ │ │ │ │ ├── AggregateFunction.java │ │ │ │ │ ├── ArrayAllComparisonExpression.java │ │ │ │ │ ├── ArrayAnyComparisonExpression.java │ │ │ │ │ ├── ArrayAppendFunction.java │ │ │ │ │ ├── ArrayConcatFunction.java │ │ │ │ │ ├── ArrayElemRefExpression.java │ │ │ │ │ ├── ArrayFillFunction.java │ │ │ │ │ ├── ArrayIndexFunction.java │ │ │ │ │ ├── ArrayLengthFunction.java │ │ │ │ │ ├── ArrayModifierFunction.java │ │ │ │ │ ├── ArrayPrependFunction.java │ │ │ │ │ ├── ArrayToStringFunction.java │ │ │ │ │ ├── AvgAggregateFunction.java │ │ │ │ │ ├── ByteBasedRegexpReplaceFunction.java │ │ │ │ │ ├── ByteBasedRegexpSplitFunction.java │ │ │ │ │ ├── ByteBasedRegexpSubstrFunction.java │ │ │ │ │ ├── CbrtFunction.java │ │ │ │ │ ├── CeilDateExpression.java │ │ │ │ │ ├── CeilDecimalExpression.java │ │ │ │ │ ├── CeilFunction.java │ │ │ │ │ ├── CeilTimestampExpression.java │ │ │ │ │ ├── CoalesceFunction.java │ │ │ │ │ ├── CompositeAggregateFunction.java │ │ │ │ │ ├── ConvertTimezoneFunction.java │ │ │ │ │ ├── CountAggregateFunction.java │ │ │ │ │ ├── CurrentDateFunction.java │ │ │ │ │ ├── CurrentTimeFunction.java │ │ │ │ │ ├── DayOfMonthFunction.java │ │ │ │ │ ├── DecodeFunction.java │ │ │ │ │ ├── DelegateConstantToCountAggregateFunction.java │ │ │ │ │ ├── DistinctCountAggregateFunction.java │ │ │ │ │ ├── DistinctValueAggregateFunction.java │ │ │ │ │ ├── DistinctValueWithCountAggregateFunction.java │ │ │ │ │ ├── EncodeFormat.java │ │ │ │ │ ├── EncodeFunction.java │ │ │ │ │ ├── ExpFunction.java │ │ │ │ │ ├── ExternalSqlTypeIdFunction.java │ │ │ │ │ ├── FirstLastValueBaseFunction.java │ │ │ │ │ ├── FirstValueFunction.java │ │ │ │ │ ├── FloorDateExpression.java │ │ │ │ │ ├── FloorDecimalExpression.java │ │ │ │ │ ├── FloorFunction.java │ │ │ │ │ ├── FunctionArgumentType.java │ │ │ │ │ ├── FunctionExpression.java │ │ │ │ │ ├── GetBitFunction.java │ │ │ │ │ ├── GetByteFunction.java │ │ │ │ │ ├── HourFunction.java │ │ │ │ │ ├── IndexStateNameFunction.java │ │ │ │ │ ├── InstrFunction.java │ │ │ │ │ ├── InvertFunction.java │ │ │ │ │ ├── JavaMathOneArgumentFunction.java │ │ │ │ │ ├── JavaMathTwoArgumentFunction.java │ │ │ │ │ ├── LTrimFunction.java │ │ │ │ │ ├── LastValueFunction.java │ │ │ │ │ ├── LengthFunction.java │ │ │ │ │ ├── LnFunction.java │ │ │ │ │ ├── LogFunction.java │ │ │ │ │ ├── LowerFunction.java │ │ │ │ │ ├── LpadFunction.java │ │ │ │ │ ├── MD5Function.java │ │ │ │ │ ├── MaxAggregateFunction.java │ │ │ │ │ ├── MinAggregateFunction.java │ │ │ │ │ ├── MinuteFunction.java │ │ │ │ │ ├── MonthFunction.java │ │ │ │ │ ├── NowFunction.java │ │ │ │ │ ├── NthValueFunction.java │ │ │ │ │ ├── OctetLengthFunction.java │ │ │ │ │ ├── PercentRankAggregateFunction.java │ │ │ │ │ ├── PercentileContAggregateFunction.java │ │ │ │ │ ├── PercentileDiscAggregateFunction.java │ │ │ │ │ ├── PowerFunction.java │ │ │ │ │ ├── PrefixFunction.java │ │ │ │ │ ├── RTrimFunction.java │ │ │ │ │ ├── RandomFunction.java │ │ │ │ │ ├── RegexpReplaceFunction.java │ │ │ │ │ ├── RegexpSplitFunction.java │ │ │ │ │ ├── RegexpSubstrFunction.java │ │ │ │ │ ├── ReverseFunction.java │ │ │ │ │ ├── RoundDateExpression.java │ │ │ │ │ ├── RoundDecimalExpression.java │ │ │ │ │ ├── RoundFunction.java │ │ │ │ │ ├── RoundTimestampExpression.java │ │ │ │ │ ├── SQLIndexTypeFunction.java │ │ │ │ │ ├── SQLTableTypeFunction.java │ │ │ │ │ ├── SQLViewTypeFunction.java │ │ │ │ │ ├── ScalarFunction.java │ │ │ │ │ ├── SecondFunction.java │ │ │ │ │ ├── SetBitFunction.java │ │ │ │ │ ├── SetByteFunction.java │ │ │ │ │ ├── SignFunction.java │ │ │ │ │ ├── SingleAggregateFunction.java │ │ │ │ │ ├── SqlTypeNameFunction.java │ │ │ │ │ ├── SqrtFunction.java │ │ │ │ │ ├── StddevPopFunction.java │ │ │ │ │ ├── StddevSampFunction.java │ │ │ │ │ ├── StringBasedRegexpReplaceFunction.java │ │ │ │ │ ├── StringBasedRegexpSplitFunction.java │ │ │ │ │ ├── StringBasedRegexpSubstrFunction.java │ │ │ │ │ ├── StringToArrayFunction.java │ │ │ │ │ ├── SubstrFunction.java │ │ │ │ │ ├── SumAggregateFunction.java │ │ │ │ │ ├── TimeUnit.java │ │ │ │ │ ├── TimezoneOffsetFunction.java │ │ │ │ │ ├── ToCharFunction.java │ │ │ │ │ ├── ToDateFunction.java │ │ │ │ │ ├── ToNumberFunction.java │ │ │ │ │ ├── ToTimeFunction.java │ │ │ │ │ ├── ToTimestampFunction.java │ │ │ │ │ ├── TrimFunction.java │ │ │ │ │ ├── TruncFunction.java │ │ │ │ │ ├── UDFExpression.java │ │ │ │ │ ├── UpperFunction.java │ │ │ │ │ ├── WeekFunction.java │ │ │ │ │ └── YearFunction.java │ │ │ │ ├── util │ │ │ │ │ └── regex │ │ │ │ │ │ ├── AbstractBasePattern.java │ │ │ │ │ │ ├── AbstractBaseSplitter.java │ │ │ │ │ │ ├── GuavaSplitter.java │ │ │ │ │ │ ├── JONIPattern.java │ │ │ │ │ │ └── JavaPattern.java │ │ │ │ └── visitor │ │ │ │ │ ├── BaseExpressionVisitor.java │ │ │ │ │ ├── CloneExpressionVisitor.java │ │ │ │ │ ├── CloneNonDeterministicExpressionVisitor.java │ │ │ │ │ ├── ExpressionVisitor.java │ │ │ │ │ ├── KeyValueExpressionVisitor.java │ │ │ │ │ ├── ProjectedColumnExpressionVisitor.java │ │ │ │ │ ├── ReplaceArrayFunctionExpressionVisitor.java │ │ │ │ │ ├── RowKeyExpressionVisitor.java │ │ │ │ │ ├── SingleAggregateFunctionVisitor.java │ │ │ │ │ ├── StatelessTraverseAllExpressionVisitor.java │ │ │ │ │ ├── StatelessTraverseNoExpressionVisitor.java │ │ │ │ │ ├── TraverseAllExpressionVisitor.java │ │ │ │ │ └── TraverseNoExpressionVisitor.java │ │ │ │ ├── filter │ │ │ │ ├── BooleanExpressionFilter.java │ │ │ │ ├── ColumnProjectionFilter.java │ │ │ │ ├── MultiCFCQKeyValueComparisonFilter.java │ │ │ │ ├── MultiCQKeyValueComparisonFilter.java │ │ │ │ ├── MultiKeyValueComparisonFilter.java │ │ │ │ ├── RowKeyComparisonFilter.java │ │ │ │ ├── SingleCFCQKeyValueComparisonFilter.java │ │ │ │ ├── SingleCQKeyValueComparisonFilter.java │ │ │ │ ├── SingleKeyValueComparisonFilter.java │ │ │ │ └── SkipScanFilter.java │ │ │ │ ├── hbase │ │ │ │ └── index │ │ │ │ │ ├── CapturingAbortable.java │ │ │ │ │ ├── IndexRegionSplitPolicy.java │ │ │ │ │ ├── Indexer.java │ │ │ │ │ ├── ValueGetter.java │ │ │ │ │ ├── balancer │ │ │ │ │ └── IndexLoadBalancer.java │ │ │ │ │ ├── builder │ │ │ │ │ ├── BaseIndexBuilder.java │ │ │ │ │ ├── IndexBuildManager.java │ │ │ │ │ ├── IndexBuilder.java │ │ │ │ │ └── IndexBuildingFailureException.java │ │ │ │ │ ├── covered │ │ │ │ │ ├── Batch.java │ │ │ │ │ ├── CoveredColumns.java │ │ │ │ │ ├── CoveredColumnsIndexBuilder.java │ │ │ │ │ ├── IndexCodec.java │ │ │ │ │ ├── IndexUpdate.java │ │ │ │ │ ├── KeyValueStore.java │ │ │ │ │ ├── LocalTableState.java │ │ │ │ │ ├── TableState.java │ │ │ │ │ ├── data │ │ │ │ │ │ ├── IndexMemStore.java │ │ │ │ │ │ ├── LazyValueGetter.java │ │ │ │ │ │ ├── LocalHBaseState.java │ │ │ │ │ │ └── LocalTable.java │ │ │ │ │ ├── example │ │ │ │ │ │ ├── ColumnGroup.java │ │ │ │ │ │ ├── CoveredColumn.java │ │ │ │ │ │ ├── CoveredColumnIndexCodec.java │ │ │ │ │ │ ├── CoveredColumnIndexSpecifierBuilder.java │ │ │ │ │ │ └── CoveredColumnIndexer.java │ │ │ │ │ ├── filter │ │ │ │ │ │ ├── ApplyAndFilterDeletesFilter.java │ │ │ │ │ │ ├── ColumnTrackingNextLargestTimestampFilter.java │ │ │ │ │ │ ├── MaxTimestampFilter.java │ │ │ │ │ │ └── NewerTimestampFilter.java │ │ │ │ │ └── update │ │ │ │ │ │ ├── ColumnReference.java │ │ │ │ │ │ ├── ColumnTracker.java │ │ │ │ │ │ ├── IndexUpdateManager.java │ │ │ │ │ │ ├── IndexedColumnGroup.java │ │ │ │ │ │ └── SortedCollection.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── IndexWriteException.java │ │ │ │ │ ├── MultiIndexWriteFailureException.java │ │ │ │ │ └── SingleIndexWriteFailureException.java │ │ │ │ │ ├── master │ │ │ │ │ └── IndexMasterObserver.java │ │ │ │ │ ├── parallel │ │ │ │ │ ├── BaseTaskRunner.java │ │ │ │ │ ├── EarlyExitFailure.java │ │ │ │ │ ├── QuickFailingTaskRunner.java │ │ │ │ │ ├── Task.java │ │ │ │ │ ├── TaskBatch.java │ │ │ │ │ ├── TaskRunner.java │ │ │ │ │ ├── ThreadPoolBuilder.java │ │ │ │ │ ├── ThreadPoolManager.java │ │ │ │ │ └── WaitForCompletionTaskRunner.java │ │ │ │ │ ├── scanner │ │ │ │ │ ├── EmptyScanner.java │ │ │ │ │ ├── FilteredKeyValueScanner.java │ │ │ │ │ ├── Scanner.java │ │ │ │ │ └── ScannerBuilder.java │ │ │ │ │ ├── table │ │ │ │ │ ├── CachingHTableFactory.java │ │ │ │ │ ├── CoprocessorHTableFactory.java │ │ │ │ │ ├── HTableFactory.java │ │ │ │ │ └── HTableInterfaceReference.java │ │ │ │ │ ├── util │ │ │ │ │ ├── GenericKeyValueBuilder.java │ │ │ │ │ ├── ImmutableBytesPtr.java │ │ │ │ │ ├── IndexManagementUtil.java │ │ │ │ │ ├── KeyValueBuilder.java │ │ │ │ │ ├── ReadOnlyImmutableBytesPtr.java │ │ │ │ │ └── VersionUtil.java │ │ │ │ │ ├── wal │ │ │ │ │ ├── IndexedKeyValue.java │ │ │ │ │ └── KeyValueCodec.java │ │ │ │ │ └── write │ │ │ │ │ ├── IndexCommitter.java │ │ │ │ │ ├── IndexFailurePolicy.java │ │ │ │ │ ├── IndexWriter.java │ │ │ │ │ ├── IndexWriterUtils.java │ │ │ │ │ ├── KillServerOnFailurePolicy.java │ │ │ │ │ ├── ParallelWriterIndexCommitter.java │ │ │ │ │ └── recovery │ │ │ │ │ ├── PerRegionIndexWriteCache.java │ │ │ │ │ ├── StoreFailuresInCachePolicy.java │ │ │ │ │ └── TrackingParallelWriterIndexCommitter.java │ │ │ │ ├── index │ │ │ │ ├── BaseIndexCodec.java │ │ │ │ ├── IndexMaintainer.java │ │ │ │ ├── IndexMetaDataCacheClient.java │ │ │ │ ├── IndexMetaDataCacheFactory.java │ │ │ │ ├── PhoenixIndexBuilder.java │ │ │ │ ├── PhoenixIndexCodec.java │ │ │ │ └── PhoenixIndexFailurePolicy.java │ │ │ │ ├── iterate │ │ │ │ ├── AggregatingResultIterator.java │ │ │ │ ├── BaseGroupedAggregatingResultIterator.java │ │ │ │ ├── BaseResultIterator.java │ │ │ │ ├── BaseResultIterators.java │ │ │ │ ├── ChunkedResultIterator.java │ │ │ │ ├── ConcatResultIterator.java │ │ │ │ ├── DefaultParallelScanGrouper.java │ │ │ │ ├── DelegateResultIterator.java │ │ │ │ ├── DistinctAggregatingResultIterator.java │ │ │ │ ├── ExplainTable.java │ │ │ │ ├── FilterAggregatingResultIterator.java │ │ │ │ ├── FilterResultIterator.java │ │ │ │ ├── GroupedAggregatingResultIterator.java │ │ │ │ ├── LimitingPeekingResultIterator.java │ │ │ │ ├── LimitingResultIterator.java │ │ │ │ ├── LookAheadResultIterator.java │ │ │ │ ├── MapReduceParallelScanGrouper.java │ │ │ │ ├── MappedByteBufferQueue.java │ │ │ │ ├── MappedByteBufferSortedQueue.java │ │ │ │ ├── MaterializedResultIterator.java │ │ │ │ ├── MergeSortResultIterator.java │ │ │ │ ├── MergeSortRowKeyResultIterator.java │ │ │ │ ├── MergeSortTopNResultIterator.java │ │ │ │ ├── OrderedAggregatingResultIterator.java │ │ │ │ ├── OrderedResultIterator.java │ │ │ │ ├── ParallelIteratorFactory.java │ │ │ │ ├── ParallelIteratorRegionSplitter.java │ │ │ │ ├── ParallelIterators.java │ │ │ │ ├── ParallelScanGrouper.java │ │ │ │ ├── PeekingResultIterator.java │ │ │ │ ├── RegionScannerResultIterator.java │ │ │ │ ├── ResultIterator.java │ │ │ │ ├── ResultIterators.java │ │ │ │ ├── RoundRobinResultIterator.java │ │ │ │ ├── ScanningResultIterator.java │ │ │ │ ├── SequenceResultIterator.java │ │ │ │ ├── SerialIterators.java │ │ │ │ ├── SpoolTooBigToDiskException.java │ │ │ │ ├── SpoolingResultIterator.java │ │ │ │ ├── TableResultIterator.java │ │ │ │ ├── UngroupedAggregatingResultIterator.java │ │ │ │ └── UnionResultIterators.java │ │ │ │ ├── jdbc │ │ │ │ ├── Jdbc7Shim.java │ │ │ │ ├── PhoenixConnection.java │ │ │ │ ├── PhoenixDatabaseMetaData.java │ │ │ │ ├── PhoenixDriver.java │ │ │ │ ├── PhoenixEmbeddedDriver.java │ │ │ │ ├── PhoenixParameterMetaData.java │ │ │ │ ├── PhoenixPreparedStatement.java │ │ │ │ ├── PhoenixResultSet.java │ │ │ │ ├── PhoenixResultSetMetaData.java │ │ │ │ ├── PhoenixStatement.java │ │ │ │ └── PhoenixStatementFactory.java │ │ │ │ ├── job │ │ │ │ ├── AbstractRoundRobinQueue.java │ │ │ │ └── JobManager.java │ │ │ │ ├── join │ │ │ │ ├── HashCacheClient.java │ │ │ │ ├── HashCacheFactory.java │ │ │ │ ├── HashJoinInfo.java │ │ │ │ └── MaxServerCacheSizeExceededException.java │ │ │ │ ├── mapreduce │ │ │ │ ├── CsvBulkImportUtil.java │ │ │ │ ├── CsvBulkLoadTool.java │ │ │ │ ├── CsvToKeyValueMapper.java │ │ │ │ ├── ImportPreUpsertKeyValueProcessor.java │ │ │ │ ├── PhoenixInputFormat.java │ │ │ │ ├── PhoenixInputSplit.java │ │ │ │ ├── PhoenixJobCounters.java │ │ │ │ ├── PhoenixOutputCommitter.java │ │ │ │ ├── PhoenixOutputFormat.java │ │ │ │ ├── PhoenixRecordReader.java │ │ │ │ ├── PhoenixRecordWriter.java │ │ │ │ ├── index │ │ │ │ │ ├── DirectHTableWriter.java │ │ │ │ │ ├── IndexTool.java │ │ │ │ │ ├── IndexToolUtil.java │ │ │ │ │ ├── PhoenixIndexDBWritable.java │ │ │ │ │ ├── PhoenixIndexImportDirectMapper.java │ │ │ │ │ ├── PhoenixIndexImportMapper.java │ │ │ │ │ └── PhoenixIndexToolReducer.java │ │ │ │ └── util │ │ │ │ │ ├── ColumnInfoToStringEncoderDecoder.java │ │ │ │ │ ├── ConnectionUtil.java │ │ │ │ │ ├── PhoenixConfigurationUtil.java │ │ │ │ │ └── PhoenixMapReduceUtil.java │ │ │ │ ├── memory │ │ │ │ ├── ChildMemoryManager.java │ │ │ │ ├── DelegatingMemoryManager.java │ │ │ │ ├── GlobalMemoryManager.java │ │ │ │ ├── InsufficientMemoryException.java │ │ │ │ └── MemoryManager.java │ │ │ │ ├── metrics │ │ │ │ ├── MetricInfo.java │ │ │ │ └── Metrics.java │ │ │ │ ├── monitoring │ │ │ │ ├── AtomicMetric.java │ │ │ │ ├── CombinableMetric.java │ │ │ │ ├── CombinableMetricImpl.java │ │ │ │ ├── GlobalClientMetrics.java │ │ │ │ ├── GlobalMetric.java │ │ │ │ ├── GlobalMetricImpl.java │ │ │ │ ├── MemoryMetricsHolder.java │ │ │ │ ├── Metric.java │ │ │ │ ├── MetricType.java │ │ │ │ ├── MetricsStopWatch.java │ │ │ │ ├── MutationMetricQueue.java │ │ │ │ ├── NonAtomicMetric.java │ │ │ │ ├── OverAllQueryMetrics.java │ │ │ │ ├── ReadMetricQueue.java │ │ │ │ ├── SpoolingMetricsHolder.java │ │ │ │ └── TaskExecutionMetricsHolder.java │ │ │ │ ├── optimize │ │ │ │ └── QueryOptimizer.java │ │ │ │ ├── parse │ │ │ │ ├── AddColumnStatement.java │ │ │ │ ├── AddJarsStatement.java │ │ │ │ ├── AddParseNode.java │ │ │ │ ├── AggregateFunctionParseNode.java │ │ │ │ ├── AggregateFunctionWithinGroupParseNode.java │ │ │ │ ├── AliasedNode.java │ │ │ │ ├── AlterIndexStatement.java │ │ │ │ ├── AlterSessionStatement.java │ │ │ │ ├── AlterTableStatement.java │ │ │ │ ├── AndParseNode.java │ │ │ │ ├── ArithmeticParseNode.java │ │ │ │ ├── ArrayAllAnyComparisonNode.java │ │ │ │ ├── ArrayAllComparisonNode.java │ │ │ │ ├── ArrayAnyComparisonNode.java │ │ │ │ ├── ArrayConstructorNode.java │ │ │ │ ├── ArrayElemRefNode.java │ │ │ │ ├── AvgAggregateParseNode.java │ │ │ │ ├── BaseParseNodeVisitor.java │ │ │ │ ├── BetweenParseNode.java │ │ │ │ ├── BinaryParseNode.java │ │ │ │ ├── BindParseNode.java │ │ │ │ ├── BindTableNode.java │ │ │ │ ├── BindableStatement.java │ │ │ │ ├── BooleanParseNodeVisitor.java │ │ │ │ ├── CaseParseNode.java │ │ │ │ ├── CastParseNode.java │ │ │ │ ├── CeilParseNode.java │ │ │ │ ├── ColumnDef.java │ │ │ │ ├── ColumnDefInPkConstraint.java │ │ │ │ ├── ColumnFamilyDef.java │ │ │ │ ├── ColumnName.java │ │ │ │ ├── ColumnParseNode.java │ │ │ │ ├── ComparisonParseNode.java │ │ │ │ ├── CompoundParseNode.java │ │ │ │ ├── ConcreteTableNode.java │ │ │ │ ├── CreateFunctionStatement.java │ │ │ │ ├── CreateIndexStatement.java │ │ │ │ ├── CreateSequenceStatement.java │ │ │ │ ├── CreateTableStatement.java │ │ │ │ ├── CurrentDateParseNode.java │ │ │ │ ├── CurrentTimeParseNode.java │ │ │ │ ├── DMLStatement.java │ │ │ │ ├── DelegateConstantToCountParseNode.java │ │ │ │ ├── DeleteJarStatement.java │ │ │ │ ├── DeleteStatement.java │ │ │ │ ├── DerivedTableNode.java │ │ │ │ ├── DistinctCountParseNode.java │ │ │ │ ├── DivideParseNode.java │ │ │ │ ├── DropColumnStatement.java │ │ │ │ ├── DropFunctionStatement.java │ │ │ │ ├── DropIndexStatement.java │ │ │ │ ├── DropSequenceStatement.java │ │ │ │ ├── DropTableStatement.java │ │ │ │ ├── EqualParseNode.java │ │ │ │ ├── ExistsParseNode.java │ │ │ │ ├── ExplainStatement.java │ │ │ │ ├── FamilyWildcardParseNode.java │ │ │ │ ├── FilterableStatement.java │ │ │ │ ├── FirstValueAggregateParseNode.java │ │ │ │ ├── FloorParseNode.java │ │ │ │ ├── FunctionParseNode.java │ │ │ │ ├── GreaterThanOrEqualParseNode.java │ │ │ │ ├── GreaterThanParseNode.java │ │ │ │ ├── HintNode.java │ │ │ │ ├── InListParseNode.java │ │ │ │ ├── InParseNode.java │ │ │ │ ├── IndexExpressionParseNodeRewriter.java │ │ │ │ ├── IndexKeyConstraint.java │ │ │ │ ├── IsNullParseNode.java │ │ │ │ ├── JoinTableNode.java │ │ │ │ ├── LastValueAggregateParseNode.java │ │ │ │ ├── LessThanOrEqualParseNode.java │ │ │ │ ├── LessThanParseNode.java │ │ │ │ ├── LikeParseNode.java │ │ │ │ ├── LimitNode.java │ │ │ │ ├── ListJarsStatement.java │ │ │ │ ├── LiteralParseNode.java │ │ │ │ ├── MaxAggregateParseNode.java │ │ │ │ ├── MinAggregateParseNode.java │ │ │ │ ├── ModulusParseNode.java │ │ │ │ ├── MultiplyParseNode.java │ │ │ │ ├── MutableStatement.java │ │ │ │ ├── NamedNode.java │ │ │ │ ├── NamedParseNode.java │ │ │ │ ├── NamedTableNode.java │ │ │ │ ├── NotEqualParseNode.java │ │ │ │ ├── NotParseNode.java │ │ │ │ ├── NthValueAggregateParseNode.java │ │ │ │ ├── OrParseNode.java │ │ │ │ ├── OrderByNode.java │ │ │ │ ├── PFunction.java │ │ │ │ ├── ParseContext.java │ │ │ │ ├── ParseException.java │ │ │ │ ├── ParseNode.java │ │ │ │ ├── ParseNodeFactory.java │ │ │ │ ├── ParseNodeRewriter.java │ │ │ │ ├── ParseNodeVisitor.java │ │ │ │ ├── PrimaryKeyConstraint.java │ │ │ │ ├── PropertyName.java │ │ │ │ ├── RegexpReplaceParseNode.java │ │ │ │ ├── RegexpSplitParseNode.java │ │ │ │ ├── RegexpSubstrParseNode.java │ │ │ │ ├── RoundParseNode.java │ │ │ │ ├── RowValueConstructorParseNode.java │ │ │ │ ├── SQLParser.java │ │ │ │ ├── SelectStatement.java │ │ │ │ ├── SelectStatementRewriter.java │ │ │ │ ├── SequenceValueParseNode.java │ │ │ │ ├── SingleTableStatement.java │ │ │ │ ├── StatelessTraverseAllParseNodeVisitor.java │ │ │ │ ├── StringConcatParseNode.java │ │ │ │ ├── SubqueryParseNode.java │ │ │ │ ├── SubtractParseNode.java │ │ │ │ ├── SumAggregateParseNode.java │ │ │ │ ├── TableName.java │ │ │ │ ├── TableNode.java │ │ │ │ ├── TableNodeVisitor.java │ │ │ │ ├── TableWildcardParseNode.java │ │ │ │ ├── TerminalParseNode.java │ │ │ │ ├── ToCharParseNode.java │ │ │ │ ├── ToDateParseNode.java │ │ │ │ ├── ToNumberParseNode.java │ │ │ │ ├── ToTimeParseNode.java │ │ │ │ ├── ToTimestampParseNode.java │ │ │ │ ├── TraceStatement.java │ │ │ │ ├── TraverseAllParseNodeVisitor.java │ │ │ │ ├── TraverseNoParseNodeVisitor.java │ │ │ │ ├── UDFParseNode.java │ │ │ │ ├── UnaryParseNode.java │ │ │ │ ├── UnsupportedAllParseNodeVisitor.java │ │ │ │ ├── UpdateStatisticsStatement.java │ │ │ │ ├── UpsertStatement.java │ │ │ │ └── WildcardParseNode.java │ │ │ │ ├── protobuf │ │ │ │ └── ProtobufUtil.java │ │ │ │ ├── query │ │ │ │ ├── BaseQueryServicesImpl.java │ │ │ │ ├── ChildQueryServices.java │ │ │ │ ├── ConfigurationFactory.java │ │ │ │ ├── ConnectionQueryServices.java │ │ │ │ ├── ConnectionQueryServicesImpl.java │ │ │ │ ├── ConnectionlessQueryServicesImpl.java │ │ │ │ ├── DelegateConnectionQueryServices.java │ │ │ │ ├── DelegateQueryServices.java │ │ │ │ ├── HBaseFactoryProvider.java │ │ │ │ ├── HConnectionFactory.java │ │ │ │ ├── HTableFactory.java │ │ │ │ ├── KeyRange.java │ │ │ │ ├── MetaDataMutated.java │ │ │ │ ├── QueryConstants.java │ │ │ │ ├── QueryServices.java │ │ │ │ ├── QueryServicesImpl.java │ │ │ │ └── QueryServicesOptions.java │ │ │ │ ├── schema │ │ │ │ ├── AmbiguousColumnException.java │ │ │ │ ├── AmbiguousTableException.java │ │ │ │ ├── ArgumentTypeMismatchException.java │ │ │ │ ├── ColumnAlreadyExistsException.java │ │ │ │ ├── ColumnFamilyNotFoundException.java │ │ │ │ ├── ColumnModifier.java │ │ │ │ ├── ColumnNotFoundException.java │ │ │ │ ├── ColumnRef.java │ │ │ │ ├── ConcurrentTableMutationException.java │ │ │ │ ├── ConstraintViolationException.java │ │ │ │ ├── DelegateColumn.java │ │ │ │ ├── DelegateDatum.java │ │ │ │ ├── DelegateTable.java │ │ │ │ ├── EmptySequenceCacheException.java │ │ │ │ ├── ExecuteQueryNotApplicableException.java │ │ │ │ ├── ExecuteUpdateNotApplicableException.java │ │ │ │ ├── FunctionAlreadyExistsException.java │ │ │ │ ├── FunctionNotFoundException.java │ │ │ │ ├── IllegalDataException.java │ │ │ │ ├── KeyValueSchema.java │ │ │ │ ├── LocalIndexDataColumnRef.java │ │ │ │ ├── MetaDataClient.java │ │ │ │ ├── MetaDataEntityNotFoundException.java │ │ │ │ ├── MetaDataSplitPolicy.java │ │ │ │ ├── NewerFunctionAlreadyExistsException.java │ │ │ │ ├── NewerTableAlreadyExistsException.java │ │ │ │ ├── PBaseColumn.java │ │ │ │ ├── PColumn.java │ │ │ │ ├── PColumnFamily.java │ │ │ │ ├── PColumnFamilyImpl.java │ │ │ │ ├── PColumnImpl.java │ │ │ │ ├── PDateColumn.java │ │ │ │ ├── PDatum.java │ │ │ │ ├── PIndexState.java │ │ │ │ ├── PIntegerColumn.java │ │ │ │ ├── PLongColumn.java │ │ │ │ ├── PMetaData.java │ │ │ │ ├── PMetaDataEntity.java │ │ │ │ ├── PMetaDataImpl.java │ │ │ │ ├── PName.java │ │ │ │ ├── PNameFactory.java │ │ │ │ ├── PNameImpl.java │ │ │ │ ├── PRow.java │ │ │ │ ├── PStringColumn.java │ │ │ │ ├── PTable.java │ │ │ │ ├── PTableImpl.java │ │ │ │ ├── PTableKey.java │ │ │ │ ├── PTableType.java │ │ │ │ ├── ProjectedColumn.java │ │ │ │ ├── ReadOnlyTableException.java │ │ │ │ ├── RowKeySchema.java │ │ │ │ ├── RowKeyValueAccessor.java │ │ │ │ ├── SaltingUtil.java │ │ │ │ ├── Sequence.java │ │ │ │ ├── SequenceAllocation.java │ │ │ │ ├── SequenceAlreadyExistsException.java │ │ │ │ ├── SequenceInfo.java │ │ │ │ ├── SequenceKey.java │ │ │ │ ├── SequenceNotFoundException.java │ │ │ │ ├── SortOrder.java │ │ │ │ ├── StaleRegionBoundaryCacheException.java │ │ │ │ ├── TableAlreadyExistsException.java │ │ │ │ ├── TableNotFoundException.java │ │ │ │ ├── TableProperty.java │ │ │ │ ├── TableRef.java │ │ │ │ ├── TypeMismatchException.java │ │ │ │ ├── ValueBitSet.java │ │ │ │ ├── ValueRangeExcpetion.java │ │ │ │ ├── ValueSchema.java │ │ │ │ ├── stats │ │ │ │ │ ├── GuidePostsInfo.java │ │ │ │ │ ├── PTableStats.java │ │ │ │ │ ├── PTableStatsImpl.java │ │ │ │ │ ├── StatisticsCollectionScope.java │ │ │ │ │ ├── StatisticsCollector.java │ │ │ │ │ ├── StatisticsScanner.java │ │ │ │ │ ├── StatisticsUtil.java │ │ │ │ │ └── StatisticsWriter.java │ │ │ │ ├── tuple │ │ │ │ │ ├── BaseTuple.java │ │ │ │ │ ├── DelegateTuple.java │ │ │ │ │ ├── MultiKeyValueTuple.java │ │ │ │ │ ├── ResultTuple.java │ │ │ │ │ ├── SingleKeyValueTuple.java │ │ │ │ │ ├── Tuple.java │ │ │ │ │ └── ValueGetterTuple.java │ │ │ │ └── types │ │ │ │ │ ├── PArrayDataType.java │ │ │ │ │ ├── PBinary.java │ │ │ │ │ ├── PBinaryArray.java │ │ │ │ │ ├── PBinaryBase.java │ │ │ │ │ ├── PBoolean.java │ │ │ │ │ ├── PBooleanArray.java │ │ │ │ │ ├── PChar.java │ │ │ │ │ ├── PCharArray.java │ │ │ │ │ ├── PDataType.java │ │ │ │ │ ├── PDataTypeFactory.java │ │ │ │ │ ├── PDate.java │ │ │ │ │ ├── PDateArray.java │ │ │ │ │ ├── PDecimal.java │ │ │ │ │ ├── PDecimalArray.java │ │ │ │ │ ├── PDouble.java │ │ │ │ │ ├── PDoubleArray.java │ │ │ │ │ ├── PFloat.java │ │ │ │ │ ├── PFloatArray.java │ │ │ │ │ ├── PInteger.java │ │ │ │ │ ├── PIntegerArray.java │ │ │ │ │ ├── PLong.java │ │ │ │ │ ├── PLongArray.java │ │ │ │ │ ├── PNumericType.java │ │ │ │ │ ├── PRealNumber.java │ │ │ │ │ ├── PSmallint.java │ │ │ │ │ ├── PSmallintArray.java │ │ │ │ │ ├── PTime.java │ │ │ │ │ ├── PTimeArray.java │ │ │ │ │ ├── PTimestamp.java │ │ │ │ │ ├── PTimestampArray.java │ │ │ │ │ ├── PTinyint.java │ │ │ │ │ ├── PTinyintArray.java │ │ │ │ │ ├── PUnsignedDate.java │ │ │ │ │ ├── PUnsignedDateArray.java │ │ │ │ │ ├── PUnsignedDouble.java │ │ │ │ │ ├── PUnsignedDoubleArray.java │ │ │ │ │ ├── PUnsignedFloat.java │ │ │ │ │ ├── PUnsignedFloatArray.java │ │ │ │ │ ├── PUnsignedInt.java │ │ │ │ │ ├── PUnsignedIntArray.java │ │ │ │ │ ├── PUnsignedLong.java │ │ │ │ │ ├── PUnsignedLongArray.java │ │ │ │ │ ├── PUnsignedSmallint.java │ │ │ │ │ ├── PUnsignedSmallintArray.java │ │ │ │ │ ├── PUnsignedTime.java │ │ │ │ │ ├── PUnsignedTimeArray.java │ │ │ │ │ ├── PUnsignedTimestamp.java │ │ │ │ │ ├── PUnsignedTimestampArray.java │ │ │ │ │ ├── PUnsignedTinyint.java │ │ │ │ │ ├── PUnsignedTinyintArray.java │ │ │ │ │ ├── PVarbinary.java │ │ │ │ │ ├── PVarbinaryArray.java │ │ │ │ │ ├── PVarchar.java │ │ │ │ │ ├── PVarcharArray.java │ │ │ │ │ ├── PWholeNumber.java │ │ │ │ │ └── PhoenixArray.java │ │ │ │ ├── trace │ │ │ │ ├── MetricsInfoImpl.java │ │ │ │ ├── PhoenixMetricsSink.java │ │ │ │ ├── TraceMetricSource.java │ │ │ │ ├── TraceReader.java │ │ │ │ ├── TracingIterator.java │ │ │ │ ├── TracingUtils.java │ │ │ │ └── util │ │ │ │ │ ├── ConfigurationAdapter.java │ │ │ │ │ ├── NullSpan.java │ │ │ │ │ └── Tracing.java │ │ │ │ └── util │ │ │ │ ├── Base62Encoder.java │ │ │ │ ├── BigDecimalUtil.java │ │ │ │ ├── BitSet.java │ │ │ │ ├── ByteUtil.java │ │ │ │ ├── CSVCommonsLoader.java │ │ │ │ ├── Closeables.java │ │ │ │ ├── ColumnInfo.java │ │ │ │ ├── ConfigUtil.java │ │ │ │ ├── DateUtil.java │ │ │ │ ├── DefaultEnvironmentEdge.java │ │ │ │ ├── EnvironmentEdge.java │ │ │ │ ├── EnvironmentEdgeManager.java │ │ │ │ ├── ExpressionUtil.java │ │ │ │ ├── FirstLastNthValueDataContainer.java │ │ │ │ ├── IndexUtil.java │ │ │ │ ├── InstanceResolver.java │ │ │ │ ├── JDBCUtil.java │ │ │ │ ├── KeyValueUtil.java │ │ │ │ ├── LogUtil.java │ │ │ │ ├── MetaDataUtil.java │ │ │ │ ├── NumberUtil.java │ │ │ │ ├── PhoenixContextExecutor.java │ │ │ │ ├── PhoenixRuntime.java │ │ │ │ ├── PhoenixStopWatch.java │ │ │ │ ├── PropertiesUtil.java │ │ │ │ ├── QueryUtil.java │ │ │ │ ├── ReadOnlyProps.java │ │ │ │ ├── ResultUtil.java │ │ │ │ ├── SQLCloseable.java │ │ │ │ ├── SQLCloseables.java │ │ │ │ ├── ScanUtil.java │ │ │ │ ├── SchemaUtil.java │ │ │ │ ├── SequenceUtil.java │ │ │ │ ├── ServerUtil.java │ │ │ │ ├── SizedUtil.java │ │ │ │ ├── StringUtil.java │ │ │ │ ├── TimeKeeper.java │ │ │ │ ├── TrustedByteArrayOutputStream.java │ │ │ │ ├── TupleUtil.java │ │ │ │ ├── UpgradeUtil.java │ │ │ │ └── csv │ │ │ │ ├── CsvUpsertExecutor.java │ │ │ │ └── StringToArrayConverter.java │ │ └── overview.html │ └── resources │ │ └── java.sql.Driver │ └── test │ ├── java │ └── org │ │ └── apache │ │ ├── hadoop │ │ ├── hbase │ │ │ ├── ipc │ │ │ │ └── PhoenixIndexRpcSchedulerTest.java │ │ │ └── regionserver │ │ │ │ └── PhoenixRpcSchedulerFactoryTest.java │ │ └── metrics2 │ │ │ ├── impl │ │ │ ├── ExposedMetricCounterLong.java │ │ │ └── ExposedMetricsRecordImpl.java │ │ │ └── lib │ │ │ └── ExposedMetricsInfoImpl.java │ │ └── phoenix │ │ ├── cache │ │ └── JodaTimezoneCacheTest.java │ │ ├── compile │ │ ├── HavingCompilerTest.java │ │ ├── JoinQueryCompilerTest.java │ │ ├── LimitCompilerTest.java │ │ ├── QueryCompilerTest.java │ │ ├── QueryMetaDataTest.java │ │ ├── QueryOptimizerTest.java │ │ ├── ScanRangesIntersectTest.java │ │ ├── ScanRangesTest.java │ │ ├── SelectStatementRewriterTest.java │ │ ├── StatementHintsCompilationTest.java │ │ ├── TenantSpecificViewIndexCompileTest.java │ │ ├── ViewCompilerTest.java │ │ ├── WhereCompilerTest.java │ │ └── WhereOptimizerTest.java │ │ ├── execute │ │ ├── CorrelatePlanTest.java │ │ ├── DescVarLengthFastByteComparisonsTest.java │ │ ├── MutationStateTest.java │ │ └── UnnestArrayPlanTest.java │ │ ├── expression │ │ ├── AbsFunctionTest.java │ │ ├── ArithmeticOperationTest.java │ │ ├── ArrayAppendFunctionTest.java │ │ ├── ArrayConcatFunctionTest.java │ │ ├── ArrayFillFunctionTest.java │ │ ├── ArrayPrependFunctionTest.java │ │ ├── ArrayToStringFunctionTest.java │ │ ├── CbrtFunctionTest.java │ │ ├── CoerceExpressionTest.java │ │ ├── ColumnExpressionTest.java │ │ ├── DeterminismTest.java │ │ ├── ExpFunctionTest.java │ │ ├── GetSetByteBitFunctionTest.java │ │ ├── ILikeExpressionTest.java │ │ ├── LikeExpressionTest.java │ │ ├── LnLogFunctionTest.java │ │ ├── NullValueTest.java │ │ ├── OctetLengthFunctionTest.java │ │ ├── PowerFunctionTest.java │ │ ├── RegexpReplaceFunctionTest.java │ │ ├── RegexpSplitFunctionTest.java │ │ ├── RegexpSubstrFunctionTest.java │ │ ├── RoundFloorCeilExpressionsTest.java │ │ ├── SignFunctionTest.java │ │ ├── SortOrderExpressionTest.java │ │ ├── SqrtFunctionTest.java │ │ ├── StringToArrayFunctionTest.java │ │ ├── function │ │ │ ├── ExternalSqlTypeIdFunctionTest.java │ │ │ └── InstrFunctionTest.java │ │ └── util │ │ │ └── regex │ │ │ └── PatternPerformanceTest.java │ │ ├── filter │ │ ├── SkipScanBigFilterTest.java │ │ ├── SkipScanFilterIntersectTest.java │ │ └── SkipScanFilterTest.java │ │ ├── hbase │ │ └── index │ │ │ ├── IndexTestingUtils.java │ │ │ ├── StubAbortable.java │ │ │ ├── TableName.java │ │ │ ├── covered │ │ │ ├── CoveredIndexCodecForTesting.java │ │ │ ├── TestCoveredColumns.java │ │ │ ├── TestLocalTableState.java │ │ │ ├── data │ │ │ │ └── TestIndexMemStore.java │ │ │ ├── example │ │ │ │ ├── TestColumnTracker.java │ │ │ │ ├── TestCoveredColumnIndexCodec.java │ │ │ │ └── TestCoveredIndexSpecifierBuilder.java │ │ │ ├── filter │ │ │ │ ├── TestApplyAndFilterDeletesFilter.java │ │ │ │ └── TestNewerTimestampFilter.java │ │ │ └── update │ │ │ │ └── TestIndexUpdateManager.java │ │ │ ├── parallel │ │ │ ├── TestThreadPoolBuilder.java │ │ │ └── TestThreadPoolManager.java │ │ │ ├── util │ │ │ └── TestIndexManagementUtil.java │ │ │ └── write │ │ │ ├── FakeTableFactory.java │ │ │ ├── TestCachingHTableFactory.java │ │ │ ├── TestIndexWriter.java │ │ │ ├── TestParalleIndexWriter.java │ │ │ ├── TestParalleWriterIndexCommitter.java │ │ │ ├── TestWALRecoveryCaching.java │ │ │ └── recovery │ │ │ └── TestPerRegionIndexWriteCache.java │ │ ├── index │ │ └── IndexMaintainerTest.java │ │ ├── iterate │ │ ├── AggregateResultScannerTest.java │ │ ├── ConcatResultIteratorTest.java │ │ ├── MergeSortResultIteratorTest.java │ │ └── SpoolingResultIteratorTest.java │ │ ├── jdbc │ │ ├── PhoenixDriverTest.java │ │ ├── PhoenixEmbeddedDriverTest.java │ │ ├── PhoenixPreparedStatementTest.java │ │ ├── PhoenixResultSetMetadataTest.java │ │ └── PhoenixTestDriver.java │ │ ├── mapreduce │ │ ├── CsvBulkImportUtilTest.java │ │ ├── CsvBulkLoadToolTest.java │ │ ├── CsvToKeyValueMapperTest.java │ │ └── util │ │ │ ├── ColumnInfoToStringEncoderDecoderTest.java │ │ │ └── PhoenixConfigurationUtilTest.java │ │ ├── memory │ │ └── MemoryManagerTest.java │ │ ├── metrics │ │ └── LoggingSink.java │ │ ├── parse │ │ ├── BuiltInFunctionInfoTest.java │ │ ├── CastParseNodeTest.java │ │ └── QueryParserTest.java │ │ ├── query │ │ ├── BaseConnectionlessQueryTest.java │ │ ├── BaseTest.java │ │ ├── ConnectionlessTest.java │ │ ├── HBaseFactoryProviderTest.java │ │ ├── KeyRangeCoalesceTest.java │ │ ├── KeyRangeIntersectTest.java │ │ ├── KeyRangeUnionTest.java │ │ ├── OrderByTest.java │ │ ├── ParallelIteratorsSplitTest.java │ │ ├── QueryPlanTest.java │ │ └── QueryServicesTestImpl.java │ │ ├── schema │ │ ├── PCharPadTest.java │ │ ├── PMetaDataImplTest.java │ │ ├── RowKeySchemaTest.java │ │ ├── RowKeyValueAccessorTest.java │ │ ├── SaltingUtilTest.java │ │ ├── SchemaUtilTest.java │ │ ├── SequenceAllocationTest.java │ │ ├── SortOrderTest.java │ │ ├── ValueBitSetTest.java │ │ └── types │ │ │ ├── BasePhoenixArrayToStringTest.java │ │ │ ├── BasePrimitiveDoublePhoenixArrayToStringTest.java │ │ │ ├── BasePrimitiveIntPhoenixArrayToStringTest.java │ │ │ ├── PDataTypeForArraysTest.java │ │ │ ├── PDataTypeTest.java │ │ │ ├── PDateArrayToStringTest.java │ │ │ ├── PVarcharArrayToStringTest.java │ │ │ ├── PrimitiveBooleanPhoenixArrayToStringTest.java │ │ │ ├── PrimitiveBytePhoenixArrayToStringTest.java │ │ │ ├── PrimitiveDoublePhoenixArrayToStringTest.java │ │ │ ├── PrimitiveFloatPhoenixArrayToStringTest.java │ │ │ ├── PrimitiveIntPhoenixArrayToStringTest.java │ │ │ ├── PrimitiveLongPhoenixArrayToStringTest.java │ │ │ └── PrimitiveShortPhoenixArrayToStringTest.java │ │ ├── trace │ │ └── TraceMetricsSourceTest.java │ │ └── util │ │ ├── AssertResults.java │ │ ├── Base62EncoderTest.java │ │ ├── ByteUtilTest.java │ │ ├── ColumnInfoTest.java │ │ ├── DateUtilTest.java │ │ ├── GeneratePerformanceData.java │ │ ├── IndexUtilTest.java │ │ ├── JDBCUtilTest.java │ │ ├── LikeExpressionTest.java │ │ ├── LogUtilTest.java │ │ ├── MetaDataUtilTest.java │ │ ├── MinVersionTestRunner.java │ │ ├── PhoenixContextExecutorTest.java │ │ ├── PhoenixEncodeDecodeTest.java │ │ ├── PhoenixRuntimeTest.java │ │ ├── PropertiesUtilTest.java │ │ ├── QueryUtilTest.java │ │ ├── ScanUtilTest.java │ │ ├── SequenceUtilTest.java │ │ ├── StringUtilTest.java │ │ ├── TenantIdByteConversionTest.java │ │ ├── TestUtil.java │ │ └── csv │ │ ├── CsvUpsertExecutorTest.java │ │ └── StringToArrayConverterTest.java │ └── resources │ ├── hadoop-metrics2.properties │ └── log4j.properties ├── phoenix-flume ├── pom.xml └── src │ ├── it │ └── java │ │ └── org │ │ └── apache │ │ └── phoenix │ │ └── flume │ │ ├── PhoenixSinkIT.java │ │ ├── RegexEventSerializerIT.java │ │ ├── serializer │ │ └── CustomSerializer.java │ │ └── sink │ │ └── NullPhoenixSink.java │ └── main │ └── java │ └── org │ └── apache │ └── phoenix │ └── flume │ ├── DefaultKeyGenerator.java │ ├── FlumeConstants.java │ ├── KeyGenerator.java │ ├── SchemaHandler.java │ ├── serializer │ ├── BaseEventSerializer.java │ ├── EventSerializer.java │ ├── EventSerializers.java │ └── RegexEventSerializer.java │ └── sink │ └── PhoenixSink.java ├── phoenix-pherf ├── README.md ├── cluster │ └── pherf.sh ├── config │ ├── datamodel │ │ └── user_defined_schema.sql │ ├── env.sh │ ├── log4j.properties │ ├── pherf.properties │ └── scenario │ │ └── user_defined_scenario.xml ├── pom.xml ├── src │ ├── it │ │ └── java │ │ │ └── org │ │ │ └── apache │ │ │ └── phoenix │ │ │ └── pherf │ │ │ ├── DataIngestIT.java │ │ │ ├── PherfMainIT.java │ │ │ ├── ResultBaseTestIT.java │ │ │ └── SchemaReaderIT.java │ ├── main │ │ ├── assembly │ │ │ ├── cluster.xml │ │ │ ├── components-minimal.xml │ │ │ ├── minimal.xml │ │ │ └── standalone.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── phoenix │ │ │ │ └── pherf │ │ │ │ ├── Pherf.java │ │ │ │ ├── PherfConstants.java │ │ │ │ ├── configuration │ │ │ │ ├── Column.java │ │ │ │ ├── DataModel.java │ │ │ │ ├── DataOverride.java │ │ │ │ ├── DataSequence.java │ │ │ │ ├── DataTypeMapping.java │ │ │ │ ├── ExecutionType.java │ │ │ │ ├── Query.java │ │ │ │ ├── QuerySet.java │ │ │ │ ├── Scenario.java │ │ │ │ ├── WriteParams.java │ │ │ │ └── XMLConfigParser.java │ │ │ │ ├── exception │ │ │ │ ├── FileLoaderException.java │ │ │ │ ├── FileLoaderRuntimeException.java │ │ │ │ ├── PherfException.java │ │ │ │ └── PherfRuntimeException.java │ │ │ │ ├── jmx │ │ │ │ ├── MonitorDetails.java │ │ │ │ ├── MonitorManager.java │ │ │ │ ├── Stat.java │ │ │ │ └── monitors │ │ │ │ │ ├── CPULoadAverageMonitor.java │ │ │ │ │ ├── FreeMemoryMonitor.java │ │ │ │ │ ├── GarbageCollectorElapsedTimeMonitor.java │ │ │ │ │ ├── HeapMemoryMonitor.java │ │ │ │ │ ├── MaxMemoryMonitor.java │ │ │ │ │ ├── Monitor.java │ │ │ │ │ ├── NonHeapMemoryMonitor.java │ │ │ │ │ ├── ObjectPendingFinalizationCountMonitor.java │ │ │ │ │ ├── ThreadMonitor.java │ │ │ │ │ └── TotalMemoryMonitor.java │ │ │ │ ├── result │ │ │ │ ├── DataLoadThreadTime.java │ │ │ │ ├── DataLoadTimeSummary.java │ │ │ │ ├── DataModelResult.java │ │ │ │ ├── QueryResult.java │ │ │ │ ├── QuerySetResult.java │ │ │ │ ├── Result.java │ │ │ │ ├── ResultHandler.java │ │ │ │ ├── ResultManager.java │ │ │ │ ├── ResultUtil.java │ │ │ │ ├── ResultValue.java │ │ │ │ ├── RunTime.java │ │ │ │ ├── ScenarioResult.java │ │ │ │ ├── ThreadTime.java │ │ │ │ ├── file │ │ │ │ │ ├── Extension.java │ │ │ │ │ ├── Header.java │ │ │ │ │ └── ResultFileDetails.java │ │ │ │ └── impl │ │ │ │ │ ├── CSVFileResultHandler.java │ │ │ │ │ ├── CSVResultHandler.java │ │ │ │ │ ├── DefaultResultHandler.java │ │ │ │ │ ├── ImageResultHandler.java │ │ │ │ │ └── XMLResultHandler.java │ │ │ │ ├── rules │ │ │ │ ├── DataValue.java │ │ │ │ └── RulesApplier.java │ │ │ │ ├── schema │ │ │ │ └── SchemaReader.java │ │ │ │ ├── util │ │ │ │ ├── GoogleChartGenerator.java │ │ │ │ ├── PhoenixUtil.java │ │ │ │ ├── ResourceList.java │ │ │ │ └── RowCalculator.java │ │ │ │ └── workload │ │ │ │ ├── MultiThreadedRunner.java │ │ │ │ ├── MultithreadedDiffer.java │ │ │ │ ├── QueryExecutor.java │ │ │ │ ├── QueryVerifier.java │ │ │ │ ├── Workload.java │ │ │ │ ├── WorkloadExecutor.java │ │ │ │ └── WriteWorkload.java │ │ └── resources │ │ │ ├── datamodel │ │ │ └── create_prod_test_unsalted.sql │ │ │ ├── hbase-site.xml │ │ │ └── scenario │ │ │ └── prod_test_unsalted_scenario.xml │ └── test │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── phoenix │ │ │ └── pherf │ │ │ ├── ColumnTest.java │ │ │ ├── ConfigurationParserTest.java │ │ │ ├── PherfTest.java │ │ │ ├── ResourceTest.java │ │ │ ├── ResultBaseTest.java │ │ │ ├── ResultTest.java │ │ │ ├── RowCalculatorTest.java │ │ │ ├── RuleGeneratorTest.java │ │ │ └── TestHBaseProps.java │ │ └── resources │ │ ├── datamodel │ │ ├── test_schema.sql │ │ └── test_schema_mt_table.sql │ │ ├── hbase-site.xml │ │ ├── pherf.test.properties │ │ └── scenario │ │ └── test_scenario.xml └── standalone │ └── pherf.sh ├── phoenix-pig ├── pom.xml └── src │ ├── it │ └── java │ │ └── org │ │ └── apache │ │ └── phoenix │ │ └── pig │ │ ├── PhoenixHBaseLoaderIT.java │ │ ├── PhoenixHBaseStorerIT.java │ │ └── udf │ │ └── ReserveNSequenceTestIT.java │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── phoenix │ │ └── pig │ │ ├── PhoenixHBaseLoader.java │ │ ├── PhoenixHBaseStorage.java │ │ ├── udf │ │ └── ReserveNSequence.java │ │ ├── util │ │ ├── PhoenixPigSchemaUtil.java │ │ ├── QuerySchemaParserFunction.java │ │ ├── SqlQueryToColumnInfoFunction.java │ │ ├── TableSchemaParserFunction.java │ │ └── TypeUtil.java │ │ └── writable │ │ └── PhoenixPigDBWritable.java │ └── test │ └── java │ └── org │ └── apache │ └── phoenix │ └── pig │ └── util │ ├── PhoenixPigSchemaUtilTest.java │ ├── QuerySchemaParserFunctionTest.java │ ├── SqlQueryToColumnInfoFunctionTest.java │ ├── TableSchemaParserFunctionTest.java │ └── TypeUtilTest.java ├── phoenix-protocol ├── README.txt └── src │ └── main │ ├── MetaDataService.proto │ ├── PFunction.proto │ ├── PGuidePosts.proto │ ├── PTable.proto │ ├── ServerCacheFactory.proto │ ├── ServerCachingService.proto │ └── build-proto.sh ├── phoenix-server-client ├── pom.xml └── src │ ├── build │ └── thin-client.xml │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── phoenix │ │ └── queryserver │ │ └── client │ │ ├── Driver.java │ │ └── ThinClientUtil.java │ └── resources │ ├── META-INF │ └── services │ │ └── java.sql.Driver │ └── version │ └── org-apache-phoenix-remote-jdbc.properties ├── phoenix-server ├── pom.xml └── src │ ├── build │ └── query-server-runnable.xml │ ├── it │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── phoenix │ │ │ └── end2end │ │ │ ├── QueryServerBasicsIT.java │ │ │ └── QueryServerThread.java │ └── resources │ │ └── log4j.properties │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── phoenix │ │ └── queryserver │ │ └── server │ │ ├── Main.java │ │ ├── PhoenixMetaFactory.java │ │ └── PhoenixMetaFactoryImpl.java │ └── test │ └── java │ └── org │ └── apache │ └── phoenix │ └── DriverCohabitationTest.java ├── phoenix-spark ├── README.md ├── pom.xml └── src │ ├── it │ ├── resources │ │ ├── log4j.xml │ │ └── setup.sql │ └── scala │ │ └── org │ │ └── apache │ │ └── phoenix │ │ └── spark │ │ └── PhoenixSparkIT.scala │ └── main │ └── scala │ └── org │ └── apache │ └── phoenix │ └── spark │ ├── ConfigurationUtil.scala │ ├── DataFrameFunctions.scala │ ├── DefaultSource.scala │ ├── PhoenixRDD.scala │ ├── PhoenixRecordWritable.scala │ ├── PhoenixRelation.scala │ ├── ProductRDDFunctions.scala │ ├── SparkContextFunctions.scala │ ├── SparkSqlContextFunctions.scala │ └── package.scala ├── phoenix-tracing-webapp ├── README.md ├── pom.xml └── src │ ├── build │ └── trace-server-runnable.xml │ ├── main │ ├── config │ │ └── checkstyle │ │ │ ├── checker.xml │ │ │ ├── header.txt │ │ │ └── suppressions.xml │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── phoenix │ │ │ └── tracingwebapp │ │ │ └── http │ │ │ ├── ConnectionFactory.java │ │ │ ├── EntityFactory.java │ │ │ ├── Main.java │ │ │ └── TraceServlet.java │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ └── font-awesome.css │ │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── index.html │ │ ├── js │ │ ├── api │ │ │ └── chart-model.js │ │ ├── app.js │ │ ├── config │ │ │ └── chart-config.js │ │ ├── controllers │ │ │ ├── accordion-controllers.js │ │ │ ├── dependency-tree-controllers.js │ │ │ ├── list-controllers.js │ │ │ ├── search-controllers.js │ │ │ ├── timeline-controllers.js │ │ │ ├── trace-count-controllers.js │ │ │ └── trace-distribution-controllers.js │ │ ├── factories │ │ │ ├── statement-factory-config.js │ │ │ └── statement-factory.js │ │ ├── lib │ │ │ ├── angular-mocks.js │ │ │ ├── angular-route.js │ │ │ ├── angular.js │ │ │ ├── bootstrap.js │ │ │ ├── jquery-2.1.4.js │ │ │ ├── jquery.min.js │ │ │ ├── ng-google-chart.js │ │ │ └── ui-bootstrap-tpls.js │ │ └── services │ │ │ └── generate-statement-service.js │ │ └── partials │ │ ├── about.html │ │ ├── chart.html │ │ ├── contact.html │ │ ├── dependency-tree.html │ │ ├── google-chart.html │ │ ├── help.html │ │ ├── home.html │ │ ├── list.html │ │ ├── phoenix-trace.html │ │ └── search.html │ └── test │ └── webapp │ └── js │ └── specs │ ├── app-route-spec.js │ ├── timeline-ctrl-spec.js │ ├── trace-list-ctrl-spec.js │ └── tracing-app-ctrl-spec.js ├── pom.xml └── src └── main └── config └── checkstyle ├── checker.xml ├── header.txt └── suppressions.xml /.gitignore: -------------------------------------------------------------------------------- 1 | #general java 2 | *.class 3 | *.war 4 | *.jar 5 | 6 | # python 7 | *.pyc 8 | 9 | # eclipse stuffs 10 | .settings/* 11 | */.settings/ 12 | .classpath 13 | .project 14 | */.externalToolBuilders 15 | */maven-eclipse.xml 16 | 17 | # intellij stuff 18 | .idea/ 19 | *.iml 20 | 21 | #maven stuffs 22 | target/ 23 | release/ 24 | RESULTS/ 25 | CSV_EXPORT/ 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](http://phoenix.apache.org/images/logo.png) 2 | 3 | [Apache Phoenix](http://phoenix.apache.org/) is a SQL skin over HBase delivered as a client-embedded JDBC driver targeting low latency queries over HBase data. Visit the Apache Phoenix website [here](http://phoenix.apache.org/). 4 | 5 | Copyright ©2014 [Apache Software Foundation](http://www.apache.org/). All Rights Reserved. 6 | -------------------------------------------------------------------------------- /bin/hadoop-metrics2-hbase.properties: -------------------------------------------------------------------------------- 1 | # HBase Server Sink Configuration 2 | ################################# 3 | # 4 | # Configuration for the metrics2 system for the HBase RegionServers 5 | # to enable phoenix trace collection on the HBase servers. 6 | # 7 | # See hadoop-metrics2-phoenix.properties for how these configurations 8 | # are utilized. 9 | # 10 | # Either this file can be used in place of the standard 11 | # hadoop-metrics2-hbase.properties file or the below 12 | # properties should be added to the file of the same name on 13 | # the HBase classpath (likely in the HBase conf/ folder) 14 | 15 | # ensure that we receive traces on the server 16 | hbase.sink.tracing.class=org.apache.phoenix.trace.PhoenixMetricsSink 17 | # Tell the sink where to write the metrics 18 | hbase.sink.tracing.writer-class=org.apache.phoenix.trace.PhoenixTableMetricsWriter 19 | # Only handle traces with a context of "tracing" 20 | hbase.sink.tracing.context=tracing 21 | -------------------------------------------------------------------------------- /bin/hbase-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 24 | 25 | 26 | hbase.regionserver.wal.codec 27 | org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec 28 | 29 | 30 | -------------------------------------------------------------------------------- /config/csv-bulk-load-config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | # 21 | 22 | mapreduce.map.output.compress=true 23 | mapreduce.map.output.compress.codec=org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.CompressionCodec 24 | io.sort.record.percent=0.2 25 | io.sort.factor=20 26 | mapred.tasktracker.map.tasks.maximum=10 27 | -------------------------------------------------------------------------------- /dev/jenkinsEnv.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | #!/bin/bash 15 | 16 | ##To set Jenkins Environment Variables: 17 | export JAVA_HOME=/home/jenkins/tools/java/latest 18 | export ANT_HOME=/home/jenkins/tools/ant/latest 19 | export XERCES_HOME=/home/jenkins/tools/xerces/latest 20 | export ECLIPSE_HOME=/home/jenkins/tools/eclipse/latest 21 | export FORREST_HOME=/home/jenkins/tools/forrest/latest 22 | export JAVA5_HOME=/home/jenkins/tools/java5/latest 23 | export FINDBUGS_HOME=/home/jenkins/tools/findbugs/latest 24 | export CLOVER_HOME=/home/jenkins/tools/clover/latest 25 | export MAVEN_HOME=/home/jenkins/tools/maven/latest 26 | 27 | export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin: 28 | export MAVEN_OPTS="${MAVEN_OPTS:-"-Xmx3100M -XX:-UsePerfData -XX:MaxPermSize=256m"}" 29 | 30 | ulimit -n 31 | 32 | -------------------------------------------------------------------------------- /dev/phoenix.importorder: -------------------------------------------------------------------------------- 1 | #Organize Import Order 2 | 4=system 3 | 3=com 4 | 2=org 5 | 1=javax 6 | 0=java 7 | -------------------------------------------------------------------------------- /examples/STOCK_SYMBOL.csv: -------------------------------------------------------------------------------- 1 | AAPL,APPLE Inc. 2 | CRM,SALESFORCE 3 | GOOG,Google 4 | HOG,Harlet-Davidson Inc. 5 | HPQ,Hewlett Packard 6 | INTC,Intel 7 | MSFT,Microsoft 8 | WAG,Walgreens 9 | WMT,Walmart 10 | -------------------------------------------------------------------------------- /examples/STOCK_SYMBOL.sql: -------------------------------------------------------------------------------- 1 | -- creates stock table with single row 2 | CREATE TABLE IF NOT EXISTS STOCK_SYMBOL (SYMBOL VARCHAR NOT NULL PRIMARY KEY, COMPANY VARCHAR); 3 | UPSERT INTO STOCK_SYMBOL VALUES ('CRM','SalesForce.com'); 4 | SELECT * FROM STOCK_SYMBOL; 5 | 6 | -------------------------------------------------------------------------------- /examples/WEB_STAT.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS WEB_STAT ( 2 | HOST CHAR(2) NOT NULL, 3 | DOMAIN VARCHAR NOT NULL, 4 | FEATURE VARCHAR NOT NULL, 5 | DATE DATE NOT NULL, 6 | USAGE.CORE BIGINT, 7 | USAGE.DB BIGINT, 8 | STATS.ACTIVE_VISITOR INTEGER 9 | CONSTRAINT PK PRIMARY KEY (HOST, DOMAIN, FEATURE, DATE) 10 | ); 11 | -------------------------------------------------------------------------------- /examples/WEB_STAT_QUERIES.sql: -------------------------------------------------------------------------------- 1 | -- Average CPU and DB usage by Domain 2 | SELECT DOMAIN, AVG(CORE) Average_CPU_Usage, AVG(DB) Average_DB_Usage 3 | FROM WEB_STAT 4 | GROUP BY DOMAIN 5 | ORDER BY DOMAIN DESC; 6 | 7 | -- Sum, Min and Max CPU usage by Salesforce grouped by day 8 | SELECT TRUNC(DATE,'DAY') DAY, SUM(CORE) TOTAL_CPU_Usage, MIN(CORE) MIN_CPU_Usage, MAX(CORE) MAX_CPU_Usage 9 | FROM WEB_STAT 10 | WHERE DOMAIN LIKE 'Salesforce%' 11 | GROUP BY TRUNC(DATE,'DAY'); 12 | 13 | -- list host and total active users when core CPU usage is 10X greater than DB usage 14 | SELECT HOST, SUM(ACTIVE_VISITOR) TOTAL_ACTIVE_VISITORS 15 | FROM WEB_STAT 16 | WHERE DB > (CORE * 10) 17 | GROUP BY HOST; 18 | -------------------------------------------------------------------------------- /examples/pig/test.pig: -------------------------------------------------------------------------------- 1 | A = load 'examples/pig/testdata' as (a:chararray, b:chararray, c:int, d:chararray, e: datetime) ; 2 | STORE A into 'hbase://TESTPHX' using org.apache.phoenix.pig.PhoenixHBaseStorage('localhost','-batchSize 1000'); 3 | -------------------------------------------------------------------------------- /examples/pig/testdata: -------------------------------------------------------------------------------- 1 | 00D300000000XHP 124 123456 weq 2012-12-12 2 | 00D300000000XHP 111 123456 nab 2012-01-21 3 | 00D300000000UIH 101 123456 ben 2014-01-01 4 | 00D300000000XHP 124 123456 weq 2012-12-12 5 | 00D300000000XHP 111 123456 nab 2012-01-21 6 | 00D300000000UIH 101 123456 ben 2014-01-01 7 | 00D300000000XHP 124 123456 weq 2012-12-12 8 | 00D300000000XHP 111 123456 nab 2012-01-21 9 | 00D300000000UIH 101 123456 ben 2014-01-01 10 | 00D300000000XHP 124 123456 weq 2012-12-12 11 | 00D300000000XHP 111 123456 nab 2012-01-21 12 | 00D300000000UIH 101 123456 ben 2014-01-01 13 | 00D300000000XHP 124 123456 weq 2012-12-12 14 | 00D300000000XHP 111 123456 nab 2012-01-21 15 | 00D300000000UIH 101 123456 ben 2014-01-01 16 | 00D300000000XHP 124 123456 weq 2012-12-12 17 | 00D300000000XHP 111 123456 nab 2012-01-21 18 | 00D300000000UIH 101 123456 ben 2014-01-01 19 | -------------------------------------------------------------------------------- /phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOwnClusterClientManagedTimeIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | *distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you maynot use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicablelaw or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.apache.phoenix.end2end; 21 | 22 | import org.junit.After; 23 | 24 | 25 | public class BaseOwnClusterClientManagedTimeIT extends BaseOwnClusterIT { 26 | @After 27 | public void cleanUpAfterTest() throws Exception { 28 | long ts = nextTimestamp(); 29 | deletePriorTables(ts - 1, getUrl()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOwnClusterHBaseManagedTimeIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | *distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you maynot use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicablelaw or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.apache.phoenix.end2end; 21 | 22 | import org.apache.hadoop.hbase.HConstants; 23 | import org.junit.After; 24 | 25 | 26 | public class BaseOwnClusterHBaseManagedTimeIT extends BaseOwnClusterIT { 27 | @After 28 | public void cleanUpAfterTest() throws Exception { 29 | deletePriorTables(HConstants.LATEST_TIMESTAMP, getUrl()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseOwnClusterIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | *distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you maynot use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicablelaw or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.apache.phoenix.end2end; 21 | 22 | import org.apache.phoenix.query.BaseTest; 23 | import org.junit.AfterClass; 24 | import org.junit.experimental.categories.Category; 25 | 26 | @Category(NeedsOwnMiniClusterTest.class) 27 | public class BaseOwnClusterIT extends BaseTest { 28 | @AfterClass 29 | public static void doTeardown() throws Exception { 30 | tearDownMiniCluster(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalMutableIndexIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.end2end.index; 19 | 20 | public class GlobalMutableIndexIT extends BaseMutableIndexIT { 21 | 22 | public GlobalMutableIndexIT() { 23 | super(false); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalMutableIndexIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.end2end.index; 19 | 20 | public class LocalMutableIndexIT extends BaseMutableIndexIT { 21 | 22 | public LocalMutableIndexIT() { 23 | super(true); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /phoenix-core/src/it/java/org/apache/phoenix/trace/PhoenixTagImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.trace; 19 | 20 | import org.apache.hadoop.metrics2.MetricsTag; 21 | 22 | /** 23 | * Simple Tag implementation for testing 24 | */ 25 | public class PhoenixTagImpl extends MetricsTag { 26 | public PhoenixTagImpl(String name, String description, String value) { 27 | super(new MetricsInfoImpl(name, description), value); 28 | } 29 | } -------------------------------------------------------------------------------- /phoenix-core/src/it/java/org/apache/phoenix/trace/TracingTestUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.trace; 19 | 20 | import org.apache.hadoop.metrics2.MetricsSink; 21 | import org.apache.phoenix.metrics.Metrics; 22 | 23 | /** 24 | * 25 | */ 26 | public class TracingTestUtil { 27 | 28 | public static void registerSink(MetricsSink sink){ 29 | Metrics.initialize().register("phoenix", "test sink gets logged", sink); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/cache/HashCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.cache; 19 | 20 | import java.io.Closeable; 21 | import java.io.IOException; 22 | import java.util.List; 23 | 24 | import org.apache.http.annotation.Immutable; 25 | import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; 26 | import org.apache.phoenix.schema.tuple.Tuple; 27 | 28 | 29 | /** 30 | * Encapsulate deserialized hash cache from bytes into Map. 31 | * The Map uses the row key as the key and the row as the value. 32 | * 33 | * @since 0.1 34 | */ 35 | @Immutable 36 | public interface HashCache extends Closeable { 37 | public List get(ImmutableBytesPtr hashKey) throws IOException; 38 | } 39 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/cache/IndexMetaDataCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.cache; 20 | 21 | import java.io.Closeable; 22 | import java.util.List; 23 | 24 | import org.apache.phoenix.index.IndexMaintainer; 25 | 26 | public interface IndexMetaDataCache extends Closeable { 27 | public List getIndexMaintainers(); 28 | } 29 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/call/CallWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.call; 19 | 20 | /** 21 | * 22 | */ 23 | public interface CallWrapper { 24 | 25 | public void before(); 26 | 27 | public void after(); 28 | 29 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/compile/ExplainPlan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.compile; 19 | 20 | import java.util.Collections; 21 | import java.util.List; 22 | 23 | import com.google.common.collect.ImmutableList; 24 | 25 | public class ExplainPlan { 26 | public static final ExplainPlan EMPTY_PLAN = new ExplainPlan(Collections.emptyList()); 27 | 28 | private final List planSteps; 29 | 30 | public ExplainPlan(List planSteps) { 31 | this.planSteps = ImmutableList.copyOf(planSteps); 32 | } 33 | 34 | public List getPlanSteps() { 35 | return planSteps; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/compile/MutationPlan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.compile; 19 | 20 | import java.sql.SQLException; 21 | 22 | import org.apache.phoenix.execute.MutationState; 23 | import org.apache.phoenix.jdbc.PhoenixConnection; 24 | 25 | 26 | public interface MutationPlan extends StatementPlan { 27 | public PhoenixConnection getConnection(); 28 | public MutationState execute() throws SQLException; 29 | } 30 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/compile/StatementPlan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.compile; 19 | 20 | import java.sql.ParameterMetaData; 21 | import java.sql.SQLException; 22 | 23 | 24 | public interface StatementPlan { 25 | StatementContext getContext(); 26 | /** 27 | * Returns the ParameterMetaData for the statement 28 | */ 29 | ParameterMetaData getParameterMetaData(); 30 | 31 | ExplainPlan getExplainPlan() throws SQLException; 32 | } 33 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GroupByCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.coprocessor; 19 | 20 | import java.io.Closeable; 21 | 22 | import org.apache.hadoop.hbase.io.ImmutableBytesWritable; 23 | import org.apache.hadoop.hbase.regionserver.RegionScanner; 24 | 25 | import org.apache.phoenix.expression.aggregator.Aggregator; 26 | 27 | /** 28 | * 29 | * Interface to abstract the way in which distinct group by 30 | * elements are cached 31 | * 32 | * 33 | * @since 3.0.0 34 | */ 35 | public interface GroupByCache extends Closeable { 36 | long size(); 37 | Aggregator[] cache(ImmutableBytesWritable key); 38 | RegionScanner getScanner(RegionScanner s); 39 | } 40 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/exception/PhoenixIOException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.exception; 19 | 20 | import java.sql.SQLException; 21 | 22 | 23 | public class PhoenixIOException extends SQLException { 24 | private static final long serialVersionUID = 1L; 25 | private static SQLExceptionCode code = SQLExceptionCode.IO_EXCEPTION; 26 | 27 | public PhoenixIOException(Throwable e) { 28 | super(e.getMessage(), code.getSQLState(), code.getErrorCode(), e); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/exception/UndecodableByteException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | *distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you maynot use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicablelaw or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.apache.phoenix.exception; 21 | 22 | 23 | public class UndecodableByteException extends RuntimeException { 24 | 25 | public UndecodableByteException(Byte b) { 26 | super("Undecodable byte: " + b); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/exception/UnknownFunctionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.exception; 19 | 20 | /** 21 | * Thrown by ParseNodeFactory when it could not identify a node as a valid function. 22 | */ 23 | public class UnknownFunctionException extends RuntimeException { 24 | private static final long serialVersionUID = 1L; 25 | private final String funcName; 26 | 27 | public UnknownFunctionException(String funcName) { 28 | super(); 29 | this.funcName = funcName; 30 | } 31 | 32 | public String getFuncName() { 33 | return funcName; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/execute/RuntimeContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.execute; 19 | 20 | import org.apache.phoenix.schema.TableRef; 21 | import org.apache.phoenix.schema.tuple.Tuple; 22 | 23 | public interface RuntimeContext { 24 | 25 | public abstract void defineCorrelateVariable(String variableId, TableRef def); 26 | 27 | public abstract TableRef getCorrelateVariableDef(String variableId); 28 | 29 | public abstract void setCorrelateVariableValue(String variableId, Tuple value); 30 | 31 | public abstract Tuple getCorrelateVariableValue(String variableId); 32 | 33 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/BaseDecimalAddSubtractExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.expression; 20 | 21 | public class BaseDecimalAddSubtractExpression { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/BaseTerminalExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression; 19 | 20 | import java.util.Collections; 21 | import java.util.List; 22 | 23 | 24 | 25 | /** 26 | * 27 | * Grouping class for expression that have no expression children 28 | * 29 | * 30 | * @since 0.1 31 | */ 32 | public abstract class BaseTerminalExpression extends BaseExpression { 33 | @Override 34 | public List getChildren() { 35 | return Collections.emptyList(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/CurrentDateTimeFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression; 19 | 20 | import java.util.List; 21 | 22 | import org.apache.phoenix.expression.function.ScalarFunction; 23 | 24 | public abstract class CurrentDateTimeFunction extends ScalarFunction { 25 | 26 | public CurrentDateTimeFunction() { 27 | } 28 | 29 | public CurrentDateTimeFunction(List children) { 30 | super(children); 31 | } 32 | 33 | @Override 34 | public boolean isStateless() { 35 | return true; 36 | } 37 | 38 | @Override 39 | public Determinism getDeterminism() { 40 | return Determinism.PER_STATEMENT; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/Determinism.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE 3 | * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file 4 | * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 5 | * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by 6 | * applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, 7 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language 8 | * governing permissions and limitations under the License. 9 | */ 10 | package org.apache.phoenix.expression; 11 | 12 | public enum Determinism { 13 | 14 | ALWAYS, PER_STATEMENT, PER_ROW, PER_INVOCATION; 15 | 16 | public Determinism combine (Determinism that) { 17 | return Determinism.values()[Math.max(this.ordinal(), that.ordinal())]; 18 | } 19 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/IntSumAggregator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.aggregator; 19 | 20 | import org.apache.phoenix.schema.types.PInteger; 21 | import org.apache.phoenix.schema.SortOrder; 22 | import org.apache.phoenix.schema.types.PDataType; 23 | 24 | /** 25 | * 26 | * Aggregator that sums integer values 27 | * 28 | * 29 | * @since 0.1 30 | */ 31 | public class IntSumAggregator extends NumberSumAggregator { 32 | 33 | public IntSumAggregator(SortOrder sortOrder) { 34 | super(sortOrder); 35 | } 36 | 37 | @Override 38 | protected PDataType getInputDataType() { 39 | return PInteger.INSTANCE; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/LongSumAggregator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.aggregator; 19 | 20 | import org.apache.phoenix.schema.types.PLong; 21 | import org.apache.phoenix.schema.SortOrder; 22 | import org.apache.phoenix.schema.types.PDataType; 23 | 24 | /** 25 | * 26 | * Aggregator that sums long values 27 | * 28 | * 29 | * @since 0.1 30 | */ 31 | public class LongSumAggregator extends NumberSumAggregator { 32 | 33 | public LongSumAggregator() { 34 | super(SortOrder.getDefault()); 35 | } 36 | 37 | @Override 38 | protected PDataType getInputDataType() { 39 | return PLong.INSTANCE; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/StddevPopAggregator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.aggregator; 19 | 20 | import java.util.List; 21 | 22 | import org.apache.phoenix.expression.Expression; 23 | import org.apache.phoenix.schema.SortOrder; 24 | 25 | /** 26 | * Client side Aggregator for STDDEV_POP aggregations 27 | * 28 | * 29 | * @since 1.2.1 30 | */ 31 | public class StddevPopAggregator extends BaseStddevAggregator { 32 | 33 | public StddevPopAggregator(List exps, SortOrder sortOrder) { 34 | super(exps, sortOrder); 35 | } 36 | 37 | @Override 38 | protected long getDataPointsCount() { 39 | return totalCount; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/aggregator/StddevSampAggregator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.aggregator; 19 | 20 | import java.util.List; 21 | 22 | import org.apache.phoenix.expression.Expression; 23 | import org.apache.phoenix.schema.SortOrder; 24 | 25 | /** 26 | * Client side Aggregator for STDDEV_SAMP aggregations 27 | * 28 | * 29 | * @since 1.2.1 30 | */ 31 | public class StddevSampAggregator extends BaseStddevAggregator { 32 | 33 | public StddevSampAggregator(List exps, SortOrder sortOrder) { 34 | super(exps, sortOrder); 35 | } 36 | 37 | @Override 38 | protected long getDataPointsCount() { 39 | return totalCount - 1; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/function/EncodeFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.apache.phoenix.expression.function; 17 | 18 | public enum EncodeFormat { 19 | 20 | HEX, //format for encoding HEX value to bytes 21 | BASE62 //format for encoding a base 10 long value to base 62 string 22 | }; 23 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBasePattern.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.util.regex; 19 | 20 | import org.apache.hadoop.hbase.io.ImmutableBytesWritable; 21 | 22 | public abstract class AbstractBasePattern { 23 | 24 | public abstract void matches(ImmutableBytesWritable srcPtr); 25 | 26 | public abstract void replaceAll(ImmutableBytesWritable srcPtr, byte[] rStrBytes, 27 | int rStrOffset, int rStrLen); 28 | 29 | public abstract void substr(ImmutableBytesWritable srcPtr, int offsetInStr); 30 | 31 | public abstract String pattern(); 32 | } 33 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.util.regex; 19 | 20 | import org.apache.hadoop.hbase.io.ImmutableBytesWritable; 21 | 22 | public abstract interface AbstractBaseSplitter { 23 | public abstract boolean split(ImmutableBytesWritable srcPtr); 24 | } 25 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/visitor/CloneNonDeterministicExpressionVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.visitor; 19 | 20 | import java.util.List; 21 | 22 | import org.apache.phoenix.expression.Determinism; 23 | import org.apache.phoenix.expression.Expression; 24 | 25 | public class CloneNonDeterministicExpressionVisitor extends CloneExpressionVisitor { 26 | 27 | public boolean isCloneNode(Expression node, List children) { 28 | return Determinism.PER_INVOCATION.compareTo(node.getDeterminism()) <= 0; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/visitor/KeyValueExpressionVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.visitor; 19 | 20 | import org.apache.phoenix.expression.KeyValueColumnExpression; 21 | 22 | 23 | 24 | 25 | /** 26 | * 27 | * Implementation of ExpressionVisitor where only KeyValueDataAccessor 28 | * is being visited 29 | * 30 | * 31 | * @since 0.1 32 | */ 33 | public abstract class KeyValueExpressionVisitor extends StatelessTraverseAllExpressionVisitor { 34 | @Override 35 | abstract public Void visit(KeyValueColumnExpression node); 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/visitor/ProjectedColumnExpressionVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.visitor; 19 | 20 | import org.apache.phoenix.expression.ProjectedColumnExpression; 21 | 22 | public abstract class ProjectedColumnExpressionVisitor extends StatelessTraverseAllExpressionVisitor { 23 | @Override 24 | abstract public Void visit(ProjectedColumnExpression node); 25 | } 26 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/visitor/RowKeyExpressionVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.visitor; 19 | 20 | import org.apache.phoenix.expression.RowKeyColumnExpression; 21 | 22 | 23 | 24 | 25 | /** 26 | * 27 | * Implementation of ExpressionVisitor where only a RowKeyColumnExpression (i.e. 28 | * a reference to a column that makes up the row key) is being visited, 29 | * 30 | * 31 | * @since 0.1 32 | */ 33 | public abstract class RowKeyExpressionVisitor extends StatelessTraverseAllExpressionVisitor { 34 | @Override 35 | abstract public Void visit(RowKeyColumnExpression node); 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/visitor/SingleAggregateFunctionVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.visitor; 19 | 20 | import java.util.Iterator; 21 | 22 | import org.apache.phoenix.expression.Expression; 23 | import org.apache.phoenix.expression.function.SingleAggregateFunction; 24 | 25 | 26 | 27 | /** 28 | * 29 | * Implementation of ExpressionVisitor where only SingleAggregateFunction 30 | * instances are visited 31 | * 32 | * 33 | * @since 0.1 34 | */ 35 | public abstract class SingleAggregateFunctionVisitor extends StatelessTraverseAllExpressionVisitor { 36 | @Override 37 | abstract public Iterator visitEnter(SingleAggregateFunction node); 38 | } 39 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/expression/visitor/TraverseNoExpressionVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.expression.visitor; 19 | 20 | import java.util.Iterator; 21 | 22 | import org.apache.phoenix.expression.Expression; 23 | 24 | import com.google.common.collect.Iterators; 25 | 26 | public abstract class TraverseNoExpressionVisitor extends BaseExpressionVisitor { 27 | 28 | @Override 29 | public Iterator defaultIterator(Expression node) { 30 | return Iterators.emptyIterator(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/hbase/index/IndexRegionSplitPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.hbase.index; 19 | 20 | import org.apache.hadoop.hbase.regionserver.RegionSplitPolicy; 21 | 22 | /** 23 | * Split policy for index regions to avoid split from external requests. 24 | */ 25 | public class IndexRegionSplitPolicy extends RegionSplitPolicy { 26 | 27 | @Override 28 | protected boolean shouldSplit() { 29 | return false; 30 | } 31 | 32 | protected boolean skipStoreFileRangeCheck() { 33 | return true; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/KeyValueStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.hbase.index.covered; 19 | 20 | import org.apache.hadoop.hbase.KeyValue; 21 | import org.apache.hadoop.hbase.regionserver.KeyValueScanner; 22 | 23 | /** 24 | * Store a collection of KeyValues in memory. 25 | */ 26 | public interface KeyValueStore { 27 | 28 | public void add(KeyValue kv, boolean overwrite); 29 | 30 | public KeyValueScanner getScanner(); 31 | 32 | public void rollback(KeyValue kv); 33 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/update/IndexedColumnGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.hbase.index.covered.update; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * Group of columns that were requested to build an index 24 | */ 25 | public interface IndexedColumnGroup { 26 | 27 | public List getColumns(); 28 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/hbase/index/parallel/EarlyExitFailure.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.hbase.index.parallel; 19 | 20 | import java.io.IOException; 21 | 22 | /** 23 | * Exception denoting a need to early-exit a task (or group of tasks) due to external notification 24 | */ 25 | @SuppressWarnings("serial") 26 | public class EarlyExitFailure extends IOException { 27 | 28 | /** 29 | * @param msg reason for the early exit 30 | */ 31 | public EarlyExitFailure(String msg) { 32 | super(msg); 33 | } 34 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/hbase/index/parallel/Task.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.hbase.index.parallel; 19 | 20 | import java.util.concurrent.Callable; 21 | 22 | import org.apache.hadoop.hbase.Abortable; 23 | 24 | /** 25 | * Like a {@link Callable}, but supports an internal {@link Abortable} that can be checked 26 | * periodically to determine if the batch should abort 27 | * @param expected result of the task 28 | */ 29 | public abstract class Task implements Callable { 30 | 31 | private Abortable batch; 32 | 33 | void setBatchMonitor(Abortable abort) { 34 | this.batch = abort; 35 | } 36 | 37 | protected boolean isBatchFailed() { 38 | return this.batch.isAborted(); 39 | } 40 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/hbase/index/table/HTableFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.hbase.index.table; 20 | 21 | import java.io.IOException; 22 | 23 | import org.apache.hadoop.hbase.client.HTableInterface; 24 | 25 | import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr; 26 | 27 | public interface HTableFactory { 28 | 29 | public HTableInterface getTable(ImmutableBytesPtr tablename) throws IOException; 30 | 31 | public void shutdown(); 32 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/iterate/AggregatingResultIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.iterate; 19 | 20 | import org.apache.phoenix.schema.tuple.Tuple; 21 | 22 | 23 | /** 24 | * 25 | * Interface for scanners that either do aggregation 26 | * or delegate to scanners that do aggregation. 27 | * 28 | * 29 | * @since 0.1 30 | */ 31 | public interface AggregatingResultIterator extends ResultIterator { 32 | /** 33 | * Provides a means of re-aggregating a result row. For 34 | * scanners that need to look ahead (i.e. {@link org.apache.phoenix.iterate.OrderedAggregatingResultIterator} 35 | * @param result the row to re-aggregate 36 | */ 37 | void aggregate(Tuple result); 38 | } 39 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.iterate; 19 | 20 | import java.sql.SQLException; 21 | import java.util.List; 22 | 23 | /** 24 | * 25 | * Abstract base class for ResultIterator implementations that 26 | * do nothing on close and have no explain plan steps 27 | * 28 | * 29 | * @since 1.2 30 | */ 31 | public abstract class BaseResultIterator implements ResultIterator { 32 | 33 | @Override 34 | public void close() throws SQLException { 35 | } 36 | 37 | @Override 38 | public void explain(List planSteps) { 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/iterate/ParallelIteratorRegionSplitter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.iterate; 19 | 20 | import java.sql.SQLException; 21 | import java.util.List; 22 | 23 | import org.apache.phoenix.query.KeyRange; 24 | 25 | 26 | /** 27 | * Interface for strategies determining how to split regions in ParallelIterators. 28 | * 29 | * 30 | */ 31 | public interface ParallelIteratorRegionSplitter { 32 | 33 | public List getSplits() throws SQLException; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/iterate/ResultIterators.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.iterate; 19 | 20 | import java.sql.SQLException; 21 | import java.util.List; 22 | 23 | import org.apache.hadoop.hbase.client.Scan; 24 | import org.apache.phoenix.query.KeyRange; 25 | import org.apache.phoenix.util.SQLCloseable; 26 | 27 | public interface ResultIterators extends SQLCloseable { 28 | public int size(); 29 | public List getSplits(); 30 | public List> getScans(); 31 | public void explain(List planSteps); 32 | public List getIterators() throws SQLException; 33 | } 34 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/iterate/SpoolTooBigToDiskException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.iterate; 20 | 21 | /** 22 | * Thrown by {@link org.apache.phoenix.iterate.SpoolingResultIterator } when 23 | * result is too big to fit into memory and too big to spool to disk. 24 | * 25 | * 26 | * 27 | */ 28 | public class SpoolTooBigToDiskException extends RuntimeException { 29 | 30 | private static final long serialVersionUID = 1L; 31 | 32 | public SpoolTooBigToDiskException(String msg) { 33 | super(msg); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixStatementFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.jdbc; 19 | 20 | public interface PhoenixStatementFactory { 21 | public PhoenixStatement newStatement(PhoenixConnection connection); 22 | } 23 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixJobCounters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.mapreduce; 19 | 20 | /** 21 | * Counters used during Map Reduce jobs 22 | * 23 | */ 24 | public enum PhoenixJobCounters { 25 | 26 | INPUT_RECORDS, 27 | FAILED_RECORDS, 28 | OUTPUT_RECORDS; 29 | } 30 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/AddJarsStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.List; 21 | 22 | public class AddJarsStatement extends MutableStatement { 23 | 24 | List jarPaths; 25 | 26 | public AddJarsStatement(List jarPaths) { 27 | this.jarPaths = jarPaths; 28 | } 29 | 30 | @Override 31 | public int getBindCount() { 32 | return 0; 33 | } 34 | 35 | public List getJarPaths() { 36 | return jarPaths; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/AggregateFunctionParseNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.List; 21 | 22 | 23 | public class AggregateFunctionParseNode extends FunctionParseNode { 24 | 25 | public AggregateFunctionParseNode(String name, List children, BuiltInFunctionInfo info) { 26 | super(name, children, info); 27 | } 28 | 29 | /** 30 | * Aggregate function are not stateless, even though all the args may be stateless, 31 | * for example, COUNT(1) 32 | */ 33 | @Override 34 | public boolean isStateless() { 35 | return false; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/AlterSessionStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.Map; 21 | 22 | public class AlterSessionStatement extends MutableStatement { 23 | 24 | private final Map props; 25 | 26 | public AlterSessionStatement(Map props) { 27 | this.props = props; 28 | } 29 | 30 | @Override 31 | public int getBindCount() { 32 | return 0; 33 | } 34 | 35 | public Map getProps(){ 36 | return props; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/AlterTableStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import org.apache.phoenix.schema.PTableType; 21 | 22 | public abstract class AlterTableStatement extends SingleTableStatement { 23 | private final PTableType tableType; 24 | 25 | AlterTableStatement(NamedTableNode table, PTableType tableType) { 26 | super(table, 0); 27 | this.tableType = tableType; 28 | } 29 | 30 | public PTableType getTableType() { 31 | return tableType; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/BinaryParseNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.Arrays; 21 | 22 | /** 23 | * 24 | * Abstract class for operators that operate on exactly two nodes 25 | * 26 | * 27 | * @since 0.1 28 | */ 29 | public abstract class BinaryParseNode extends CompoundParseNode { 30 | 31 | BinaryParseNode(ParseNode lhs, ParseNode rhs) { 32 | super(Arrays.asList(lhs, rhs)); 33 | } 34 | 35 | public ParseNode getLHS() { 36 | return getChildren().get(0); 37 | } 38 | 39 | public ParseNode getRHS() { 40 | return getChildren().get(1); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/BindableStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import org.apache.phoenix.jdbc.PhoenixStatement.Operation; 21 | 22 | 23 | public interface BindableStatement { 24 | public int getBindCount(); 25 | public Operation getOperation(); 26 | } 27 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/DMLStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.Map; 21 | 22 | public class DMLStatement extends SingleTableStatement { 23 | 24 | private final Map udfParseNodes; 25 | 26 | public DMLStatement(NamedTableNode table, int bindCount, Map udfParseNodes) { 27 | super(table, bindCount); 28 | this.udfParseNodes = udfParseNodes; 29 | } 30 | 31 | public Map getUdfParseNodes() { 32 | return udfParseNodes; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/DeleteJarStatement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | public class DeleteJarStatement extends MutableStatement { 21 | 22 | private LiteralParseNode jarPath; 23 | 24 | public DeleteJarStatement(LiteralParseNode jarPath) { 25 | this.jarPath = jarPath; 26 | } 27 | 28 | @Override 29 | public int getBindCount() { 30 | return 0; 31 | } 32 | 33 | public LiteralParseNode getJarPath() { 34 | return jarPath; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/DropFunctionStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | public class DropFunctionStatement extends MutableStatement { 21 | 22 | private final String functionName; 23 | private final boolean ifExists; 24 | public DropFunctionStatement(String functionName, boolean ifExists) { 25 | this.functionName = functionName; 26 | this.ifExists = ifExists; 27 | } 28 | 29 | @Override 30 | public int getBindCount() { 31 | return 0; 32 | } 33 | 34 | public String getFunctionName() { 35 | return functionName; 36 | } 37 | 38 | public boolean ifExists() { 39 | return ifExists; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/EqualParseNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; 21 | 22 | 23 | /** 24 | * 25 | * Node representing the equal operator in SQL 26 | * 27 | * 28 | * @since 0.1 29 | */ 30 | public class EqualParseNode extends ComparisonParseNode { 31 | 32 | EqualParseNode(ParseNode lhs, ParseNode rhs) { 33 | super(lhs, rhs); 34 | } 35 | 36 | @Override 37 | public CompareOp getFilterOp() { 38 | return CompareOp.EQUAL; 39 | } 40 | 41 | @Override 42 | public CompareOp getInvertFilterOp() { 43 | return CompareOp.EQUAL; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/FilterableStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.List; 21 | 22 | public interface FilterableStatement extends BindableStatement { 23 | public HintNode getHint(); 24 | public ParseNode getWhere(); 25 | public boolean isDistinct(); 26 | public boolean isAggregate(); 27 | public List getOrderBy(); 28 | public LimitNode getLimit(); 29 | } 30 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/ListJarsStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import org.apache.phoenix.jdbc.PhoenixStatement.Operation; 21 | 22 | public class ListJarsStatement implements BindableStatement { 23 | 24 | @Override 25 | public int getBindCount() { 26 | return 0; 27 | } 28 | 29 | @Override 30 | public Operation getOperation() { 31 | return Operation.QUERY; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/MutableStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import org.apache.phoenix.jdbc.PhoenixStatement.Operation; 21 | 22 | public abstract class MutableStatement implements BindableStatement { 23 | 24 | @Override 25 | public Operation getOperation() { 26 | return Operation.UPSERT; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/ParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | /** 21 | * 22 | * RuntimeException for exceptions occurring during parsing, 23 | * since ANTLR doesn't handle typed exceptions well. 24 | * 25 | * 26 | * @since 2.0 27 | */ 28 | public class ParseException extends RuntimeException { 29 | 30 | public ParseException() { 31 | } 32 | 33 | public ParseException(String msg) { 34 | super(msg); 35 | } 36 | 37 | public ParseException(Throwable t) { 38 | super(t); 39 | } 40 | 41 | public ParseException(String msg, Throwable t) { 42 | super(msg, t); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/SingleTableStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | public abstract class SingleTableStatement extends MutableStatement { 21 | private final NamedTableNode table; 22 | private final int bindCount; 23 | 24 | public SingleTableStatement(NamedTableNode table, int bindCount) { 25 | this.table = table; 26 | this.bindCount = bindCount; 27 | } 28 | 29 | public NamedTableNode getTable() { 30 | return table; 31 | } 32 | 33 | @Override 34 | public int getBindCount() { 35 | return bindCount; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/TableNodeVisitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.sql.SQLException; 21 | 22 | 23 | /** 24 | * 25 | * Visitor for nodes in the FROM clause 26 | * 27 | * 28 | * @since 0.1 29 | */ 30 | public interface TableNodeVisitor { 31 | E visit(BindTableNode boundTableNode) throws SQLException; 32 | E visit(JoinTableNode joinNode) throws SQLException; 33 | E visit(NamedTableNode namedTableNode) throws SQLException; 34 | E visit(DerivedTableNode subselectNode) throws SQLException; 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/TerminalParseNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.Collections; 21 | import java.util.List; 22 | 23 | /** 24 | * 25 | * Abstract node for expressions that have no children 26 | * 27 | * 28 | * @since 0.1 29 | */ 30 | public abstract class TerminalParseNode extends ParseNode { 31 | @Override 32 | public final List getChildren() { 33 | return Collections.emptyList(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/UDFParseNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.List; 21 | 22 | public class UDFParseNode extends FunctionParseNode { 23 | 24 | public UDFParseNode(String name, List children, BuiltInFunctionInfo info) { 25 | super(name, children, info); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/parse/UnaryParseNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.parse; 19 | 20 | import java.util.Collections; 21 | 22 | /** 23 | * 24 | * Abstract node representing an expression that has a single child in SQL 25 | * 26 | * 27 | * @since 0.1 28 | */ 29 | public abstract class UnaryParseNode extends CompoundParseNode { 30 | UnaryParseNode(ParseNode expr) { 31 | super(Collections.singletonList(expr)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.query; 19 | 20 | import org.apache.phoenix.util.ReadOnlyProps; 21 | 22 | 23 | 24 | 25 | 26 | /** 27 | * 28 | * Real implementation of QueryServices for use in runtime and perf testing 29 | * 30 | * 31 | * @since 0.1 32 | */ 33 | public final class QueryServicesImpl extends BaseQueryServicesImpl { 34 | 35 | public QueryServicesImpl(ReadOnlyProps defaultProps) { 36 | super(defaultProps, QueryServicesOptions.withDefaults()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataEntityNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema; 19 | 20 | import java.sql.SQLException; 21 | 22 | public abstract class MetaDataEntityNotFoundException extends SQLException { 23 | private static final long serialVersionUID = 1L; 24 | 25 | public MetaDataEntityNotFoundException(String reason, String sqlState, int code, Throwable cause) { 26 | super(reason, sqlState, code, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/NewerTableAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema; 19 | 20 | public class NewerTableAlreadyExistsException extends TableAlreadyExistsException { 21 | private static final long serialVersionUID = 1L; 22 | private final PTable table; 23 | 24 | public NewerTableAlreadyExistsException(String schemaName, String tableName) { 25 | this(schemaName, tableName, null); 26 | } 27 | 28 | public NewerTableAlreadyExistsException(String schemaName, String tableName, PTable table) { 29 | super(schemaName, tableName); 30 | this.table = table; 31 | } 32 | 33 | public PTable getTable() { 34 | return table; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/PDateColumn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema; 19 | 20 | import org.apache.phoenix.schema.types.PDataType; 21 | import org.apache.phoenix.schema.types.PDate; 22 | 23 | abstract public class PDateColumn extends PBaseColumn { 24 | @Override 25 | public PDataType getDataType() { 26 | return PDate.INSTANCE; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/PIntegerColumn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema; 19 | 20 | import org.apache.phoenix.schema.types.PDataType; 21 | import org.apache.phoenix.schema.types.PInteger; 22 | 23 | /** 24 | * 25 | * Base class for PColumn implementors of type Integer. 26 | * 27 | * 28 | * @since 0.1 29 | */ 30 | public abstract class PIntegerColumn extends PBaseColumn { 31 | @Override 32 | public final PDataType getDataType() { 33 | return PInteger.INSTANCE; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/PLongColumn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema; 19 | 20 | import org.apache.phoenix.schema.types.PDataType; 21 | import org.apache.phoenix.schema.types.PLong; 22 | 23 | /** 24 | * 25 | * Base class for PColumn implementors of type Long. 26 | * 27 | * 28 | * @since 0.1 29 | */ 30 | public abstract class PLongColumn extends PBaseColumn { 31 | @Override 32 | public final PDataType getDataType() { 33 | return PLong.INSTANCE; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/PMetaDataEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema; 19 | 20 | public interface PMetaDataEntity { 21 | public int getEstimatedSize(); 22 | } 23 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/PStringColumn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema; 19 | 20 | import org.apache.phoenix.schema.types.PDataType; 21 | import org.apache.phoenix.schema.types.PVarchar; 22 | 23 | /** 24 | * 25 | * Abstract class for columns of type {@link org.apache.phoenix.schema.types.PVarchar} 26 | * 27 | * 28 | * @since 0.1 29 | */ 30 | public abstract class PStringColumn extends PBaseColumn { 31 | 32 | @Override 33 | public PDataType getDataType() { 34 | return PVarchar.INSTANCE; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsCollectionScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | *distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you maynot use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicablelaw or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.apache.phoenix.schema.stats; 21 | 22 | public enum StatisticsCollectionScope { 23 | COLUMNS, INDEX, ALL; 24 | 25 | public static StatisticsCollectionScope getDefault() { 26 | return ALL; 27 | } 28 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/schema/tuple/BaseTuple.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema.tuple; 19 | 20 | 21 | public abstract class BaseTuple implements Tuple { 22 | 23 | @Override 24 | public long getSequenceValue(int index) { 25 | throw new UnsupportedOperationException(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/util/DefaultEnvironmentEdge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package org.apache.phoenix.util; 20 | 21 | /** 22 | * Default implementation of an environment edge. 23 | */ 24 | public class DefaultEnvironmentEdge implements EnvironmentEdge { 25 | /** 26 | * {@inheritDoc} 27 | *

28 | * This implementation returns {@link System#currentTimeMillis()} 29 | */ 30 | @Override 31 | public long currentTime() { 32 | return System.currentTimeMillis(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/util/EnvironmentEdge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package org.apache.phoenix.util; 20 | 21 | /** 22 | * Has some basic interaction with the environment. Alternate implementations 23 | * can be used where required (eg in tests). 24 | * 25 | * @see EnvironmentEdgeManager 26 | */ 27 | public interface EnvironmentEdge { 28 | /** 29 | * Returns the currentTime. 30 | * 31 | * @return Current time. 32 | */ 33 | long currentTime(); 34 | } 35 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/util/SQLCloseable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.util; 19 | 20 | import java.sql.SQLException; 21 | 22 | /** 23 | * 24 | * Interface for a SQL resource that should be closed 25 | * after it is no longer in use. 26 | * 27 | * 28 | * @since 0.1 29 | */ 30 | public interface SQLCloseable { 31 | void close() throws SQLException; 32 | } 33 | -------------------------------------------------------------------------------- /phoenix-core/src/main/java/org/apache/phoenix/util/TimeKeeper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.util; 19 | 20 | public interface TimeKeeper { 21 | static final TimeKeeper SYSTEM = new TimeKeeper() { 22 | @Override 23 | public long getCurrentTime() { 24 | return System.currentTimeMillis(); 25 | } 26 | }; 27 | 28 | long getCurrentTime(); 29 | } -------------------------------------------------------------------------------- /phoenix-core/src/main/resources/java.sql.Driver: -------------------------------------------------------------------------------- 1 | org.apache.phoenix.jdbc.PhoenixDriver 2 | -------------------------------------------------------------------------------- /phoenix-core/src/test/java/org/apache/hadoop/metrics2/impl/ExposedMetricCounterLong.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.hadoop.metrics2.impl; 19 | 20 | import org.apache.hadoop.metrics2.MetricsInfo; 21 | 22 | /** 23 | * 24 | */ 25 | public class ExposedMetricCounterLong extends MetricCounterLong { 26 | 27 | 28 | 29 | /** 30 | * @param info 31 | * @param value 32 | */ 33 | public ExposedMetricCounterLong(MetricsInfo info, long value) { 34 | super(info, value); 35 | } 36 | } -------------------------------------------------------------------------------- /phoenix-core/src/test/java/org/apache/hadoop/metrics2/lib/ExposedMetricsInfoImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.hadoop.metrics2.lib; 19 | 20 | import org.apache.hadoop.metrics2.lib.MetricsInfoImpl; 21 | 22 | /** 23 | * Helper class to expose access to the {@link org.apache.hadoop.metrics2.lib.MetricsInfoImpl} 24 | */ 25 | public class ExposedMetricsInfoImpl extends MetricsInfoImpl { 26 | 27 | /** 28 | * @param name 29 | * @param description 30 | */ 31 | public ExposedMetricsInfoImpl(String name, String description) { 32 | super(name, description); 33 | } 34 | } -------------------------------------------------------------------------------- /phoenix-core/src/test/java/org/apache/phoenix/schema/types/PrimitiveBytePhoenixArrayToStringTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license 3 | * agreements. See the NOTICE file distributed with this work for additional information regarding 4 | * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the 5 | * "License"); you may not use this file except in compliance with the License. You may obtain a 6 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 7 | * law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 8 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 9 | * for the specific language governing permissions and limitations under the License. 10 | */ 11 | package org.apache.phoenix.schema.types; 12 | 13 | public class PrimitiveBytePhoenixArrayToStringTest extends BasePrimitiveIntPhoenixArrayToStringTest { 14 | 15 | @Override 16 | protected PDataType getBaseType() { 17 | return PTinyint.INSTANCE; 18 | } 19 | 20 | @Override 21 | protected Number getElement1() { 22 | return (byte) 1; 23 | } 24 | 25 | @Override 26 | protected Number getElement2() { 27 | return (byte) 2; 28 | } 29 | 30 | @Override 31 | protected Number getElement3() { 32 | return (byte) 3; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /phoenix-core/src/test/java/org/apache/phoenix/schema/types/PrimitiveDoublePhoenixArrayToStringTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license 3 | * agreements. See the NOTICE file distributed with this work for additional information regarding 4 | * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the 5 | * "License"); you may not use this file except in compliance with the License. You may obtain a 6 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 7 | * law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 8 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 9 | * for the specific language governing permissions and limitations under the License. 10 | */ 11 | package org.apache.phoenix.schema.types; 12 | 13 | public class PrimitiveDoublePhoenixArrayToStringTest extends 14 | BasePrimitiveDoublePhoenixArrayToStringTest { 15 | 16 | @Override 17 | protected PDataType getBaseType() { 18 | return PDouble.INSTANCE; 19 | } 20 | 21 | @Override 22 | protected Object getElement1() { 23 | return 1.1; 24 | } 25 | 26 | @Override 27 | protected Object getElement2() { 28 | return 2.2; 29 | } 30 | 31 | @Override 32 | protected Object getElement3() { 33 | return 3.3; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-core/src/test/java/org/apache/phoenix/schema/types/PrimitiveFloatPhoenixArrayToStringTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license 3 | * agreements. See the NOTICE file distributed with this work for additional information regarding 4 | * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the 5 | * "License"); you may not use this file except in compliance with the License. You may obtain a 6 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 7 | * law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 8 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 9 | * for the specific language governing permissions and limitations under the License. 10 | */ 11 | package org.apache.phoenix.schema.types; 12 | 13 | public class PrimitiveFloatPhoenixArrayToStringTest extends BasePrimitiveDoublePhoenixArrayToStringTest { 14 | 15 | @Override 16 | protected PDataType getBaseType() { 17 | return PFloat.INSTANCE; 18 | } 19 | 20 | @Override 21 | protected Object getElement1() { 22 | return 1.1f; 23 | } 24 | 25 | @Override 26 | protected Object getElement2() { 27 | return 2.2f; 28 | 29 | } 30 | 31 | @Override 32 | protected Object getElement3() { 33 | return 3.3f; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-core/src/test/java/org/apache/phoenix/schema/types/PrimitiveIntPhoenixArrayToStringTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.schema.types; 19 | 20 | public class PrimitiveIntPhoenixArrayToStringTest extends BasePrimitiveIntPhoenixArrayToStringTest { 21 | 22 | @Override 23 | protected PDataType getBaseType() { 24 | return PInteger.INSTANCE; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /phoenix-core/src/test/java/org/apache/phoenix/schema/types/PrimitiveLongPhoenixArrayToStringTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license 3 | * agreements. See the NOTICE file distributed with this work for additional information regarding 4 | * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the 5 | * "License"); you may not use this file except in compliance with the License. You may obtain a 6 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 7 | * law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 8 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 9 | * for the specific language governing permissions and limitations under the License. 10 | */ 11 | package org.apache.phoenix.schema.types; 12 | 13 | public class PrimitiveLongPhoenixArrayToStringTest extends BasePrimitiveIntPhoenixArrayToStringTest { 14 | 15 | @Override 16 | protected PDataType getBaseType() { 17 | return PLong.INSTANCE; 18 | } 19 | 20 | @Override 21 | protected Number getElement1() { 22 | return 1L; 23 | } 24 | 25 | @Override 26 | protected Number getElement2() { 27 | return 2L; 28 | } 29 | 30 | @Override 31 | protected Number getElement3() { 32 | return 3L; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-core/src/test/java/org/apache/phoenix/schema/types/PrimitiveShortPhoenixArrayToStringTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more contributor license 3 | * agreements. See the NOTICE file distributed with this work for additional information regarding 4 | * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the 5 | * "License"); you may not use this file except in compliance with the License. You may obtain a 6 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 7 | * law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 8 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 9 | * for the specific language governing permissions and limitations under the License. 10 | */ 11 | package org.apache.phoenix.schema.types; 12 | 13 | public class PrimitiveShortPhoenixArrayToStringTest extends 14 | BasePrimitiveIntPhoenixArrayToStringTest { 15 | 16 | @Override 17 | protected PDataType getBaseType() { 18 | return PSmallint.INSTANCE; 19 | } 20 | 21 | @Override 22 | protected Short getElement1() { 23 | return (short) 1; 24 | } 25 | 26 | @Override 27 | protected Short getElement2() { 28 | return (short) 2; 29 | } 30 | 31 | @Override 32 | protected Short getElement3() { 33 | return (short) 3; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-core/src/test/resources/hadoop-metrics2.properties: -------------------------------------------------------------------------------- 1 | #There are two options with file names: 2 | # 1. hadoop-metrics2-[prefix].properties 3 | # 2. hadoop-metrics2.properties 4 | # Either will be loaded by the metrics system (but not both). 5 | # 6 | # NOTE: The metrics system is only initialized once per JVM (but does ref-counting, so we can't 7 | #shutdown and restart), so we only load the first prefix that we find. Generally, this will be 8 | #phoenix (unless someone else registers first, but for many clients, there should only be one). 9 | # 10 | # Usually, you would use hadoop-metrics2-phoenix.properties, but we use the generic 11 | # hadoop-metrics2.properties to ensure it these are loaded regardless of where we are running, 12 | # assuming there isn't another config on the classpath. 13 | 14 | # 15 | # When specifying sinks, the syntax to use is: 16 | # [prefix].[source|sink].[instance].[options] 17 | # See javadoc of package-info.java for org.apache.hadoop.metrics2 for detail 18 | 19 | 20 | # Don't attempt to start jmx mbeans for all sources. 21 | # For right now, all metrics are exported to a phoenix table 22 | *.source.start_mbeans=false 23 | 24 | # Frequency, in seconds, of sampling from the sources 25 | *.period=10 -------------------------------------------------------------------------------- /phoenix-flume/src/it/java/org/apache/phoenix/flume/sink/NullPhoenixSink.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.flume.sink; 19 | 20 | public class NullPhoenixSink extends PhoenixSink { 21 | } 22 | -------------------------------------------------------------------------------- /phoenix-flume/src/main/java/org/apache/phoenix/flume/KeyGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.flume; 19 | 20 | public interface KeyGenerator { 21 | 22 | public String generate(); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /phoenix-flume/src/main/java/org/apache/phoenix/flume/serializer/EventSerializers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.flume.serializer; 19 | 20 | public enum EventSerializers { 21 | 22 | REGEX(RegexEventSerializer.class.getName()); 23 | 24 | private final String className; 25 | 26 | private EventSerializers(String serializerClassName) { 27 | this.className = serializerClassName; 28 | } 29 | 30 | /** 31 | * @return Returns the serializer className. 32 | */ 33 | public String getClassName() { 34 | return className; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-pherf/cluster/pherf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | source config/env.sh 20 | HBASE_CLASSPATH=`$HBASE_PATH/bin/hbase classpath` 21 | 22 | 23 | PHERF_HOME=$(cd "`dirname $0`" && pwd) 24 | CLASSPATH=${HBASE_CLASSPATH} 25 | CLASSPATH=${PHERF_HOME}/config:${CLASSPATH} 26 | 27 | for f in $PHERF_HOME/lib/*.jar; do 28 | CLASSPATH=${CLASSPATH}:$f; 29 | done 30 | 31 | CMD="time ${JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} ${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf ${@}" 32 | 33 | eval $CMD 34 | -------------------------------------------------------------------------------- /phoenix-pherf/config/datamodel/user_defined_schema.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */ 18 | CREATE TABLE IF NOT EXISTS PHERF.USER_DEFINED_TEST ( 19 | TENANT_ID CHAR(15) NOT NULL, 20 | CREATED_DATE DATE NOT NULL, 21 | VAL_STRING VARCHAR 22 | CONSTRAINT PK PRIMARY KEY 23 | ( 24 | TENANT_ID, 25 | CREATED_DATE DESC 26 | ) 27 | ) VERSIONS=1,MULTI_TENANT=true,SALT_BUCKETS=16 28 | -------------------------------------------------------------------------------- /phoenix-pherf/config/env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # Required variable to point to Java installation 20 | JAVA_HOME= 21 | 22 | # Absolute path the the unzipped directory of the HBase installation 23 | # This is required if you build using the default or cluster profile 24 | # Cluster profile assumes you want to pick up dependencies from HBase classpath 25 | # Not required in standalone. 26 | HBASE_PATH= 27 | 28 | # Add a space seperated list of -D environment args. "-Dkey1-val1 -Dkey2=val2" 29 | ENV_PROPS="" 30 | 31 | # Uncomment if you would like to remotely debug 32 | #REMOTE_DEBUG="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=6666" 33 | -------------------------------------------------------------------------------- /phoenix-pherf/src/it/java/org/apache/phoenix/pherf/PherfMainIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf; 20 | 21 | import org.junit.Rule; 22 | import org.junit.Test; 23 | import org.junit.contrib.java.lang.system.ExpectedSystemExit; 24 | 25 | public class PherfMainIT extends ResultBaseTestIT { 26 | @Rule 27 | public final ExpectedSystemExit exit = ExpectedSystemExit.none(); 28 | 29 | @Test 30 | public void testPherfMain() { 31 | String[] args = { "-q", 32 | "--scenarioFile", ".*prod_test_unsalted_scenario.*", 33 | "-m", "--monitorFrequency", "10" }; 34 | Pherf.main(args); 35 | } 36 | } -------------------------------------------------------------------------------- /phoenix-pherf/src/main/assembly/components-minimal.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | true 23 | / 24 | 25 | org.apache.phoenix:phoenix-pherf 26 | org.jfree:* 27 | com.googlecode.java-diff-utils:diffutils 28 | org.apache.commons:commons-lang3 29 | org.apache.commons:commons-math3 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/DataOverride.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.configuration; 20 | 21 | import java.util.List; 22 | 23 | import javax.xml.bind.annotation.XmlType; 24 | 25 | @XmlType 26 | public class DataOverride { 27 | private List column; 28 | 29 | public List getColumn() { 30 | return column; 31 | } 32 | 33 | @SuppressWarnings("unused") 34 | public void setColumn(List column) { 35 | this.column = column; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/DataSequence.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.configuration; 20 | 21 | public enum DataSequence { 22 | RANDOM, SEQUENTIAL,LIST; 23 | } -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/ExecutionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.configuration; 20 | 21 | public enum ExecutionType { 22 | SERIAL, PARALLEL; 23 | } 24 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/exception/FileLoaderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.exception; 20 | 21 | public class FileLoaderException extends PherfException { 22 | public FileLoaderException(String message) throws Exception { 23 | super(message); 24 | } 25 | 26 | @SuppressWarnings("unused") 27 | public FileLoaderException(String message, Exception e) { 28 | super(message, e); 29 | } 30 | } -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/exception/FileLoaderRuntimeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.exception; 20 | 21 | public class FileLoaderRuntimeException extends PherfRuntimeException { 22 | @SuppressWarnings("unused") 23 | public FileLoaderRuntimeException(String message) throws Exception { 24 | super(message); 25 | } 26 | public FileLoaderRuntimeException(String message, Exception e) { 27 | super(message, e); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/exception/PherfException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.exception; 20 | 21 | public class PherfException extends Exception { 22 | public PherfException(String message) throws Exception{ 23 | super(message); 24 | } 25 | 26 | public PherfException(String message, Exception e) { 27 | super(message, e); 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/exception/PherfRuntimeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.exception; 20 | 21 | public class PherfRuntimeException extends RuntimeException { 22 | public PherfRuntimeException(String message) throws Exception{ 23 | super(message); 24 | } 25 | 26 | public PherfRuntimeException(String message, Exception e) { 27 | super(message, e); 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/Stat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx; 20 | 21 | public class Stat { 22 | private final T stat; 23 | 24 | public Stat(T stat) { 25 | this.stat = stat; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return stat.toString(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/CPULoadAverageMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | import java.lang.management.ManagementFactory; 24 | import java.lang.management.MemoryMXBean; 25 | 26 | public class CPULoadAverageMonitor implements Monitor { 27 | 28 | @Override 29 | public Stat getStat() { 30 | Stat stat = new Stat(ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage()); 31 | return stat; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/FreeMemoryMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | public class FreeMemoryMonitor implements Monitor { 24 | 25 | @Override 26 | public Stat getStat() { 27 | Stat stat = new Stat(new Long(Runtime.getRuntime().freeMemory())); 28 | return stat; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/HeapMemoryMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | import java.lang.management.ManagementFactory; 24 | 25 | public class HeapMemoryMonitor implements Monitor { 26 | 27 | @Override 28 | public Stat getStat() { 29 | Stat stat = new Stat(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed()); 30 | return stat; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/MaxMemoryMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | public class MaxMemoryMonitor implements Monitor { 24 | 25 | @Override 26 | public Stat getStat() { 27 | Stat stat = new Stat(new Long(Runtime.getRuntime().maxMemory())); 28 | return stat; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/Monitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | import javax.management.MXBean; 24 | 25 | @MXBean 26 | public interface Monitor { 27 | 28 | public Stat getStat(); 29 | 30 | } -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/NonHeapMemoryMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | import java.lang.management.ManagementFactory; 24 | 25 | public class NonHeapMemoryMonitor implements Monitor { 26 | 27 | @Override 28 | public Stat getStat() { 29 | Stat stat = new Stat(ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().getUsed()); 30 | return stat; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/ObjectPendingFinalizationCountMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | import java.lang.management.ManagementFactory; 24 | import java.lang.management.MemoryMXBean; 25 | 26 | public class ObjectPendingFinalizationCountMonitor implements Monitor { 27 | 28 | @Override 29 | public Stat getStat() { 30 | Stat stat = new Stat(ManagementFactory.getMemoryMXBean().getObjectPendingFinalizationCount()); 31 | return stat; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/ThreadMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | import java.lang.management.ManagementFactory; 24 | 25 | public class ThreadMonitor implements Monitor { 26 | 27 | @Override 28 | public Stat getStat() { 29 | Stat stat = new Stat(new Integer(ManagementFactory.getThreadMXBean().getThreadCount())); 30 | return stat; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/TotalMemoryMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.jmx.monitors; 20 | 21 | import org.apache.phoenix.pherf.jmx.Stat; 22 | 23 | public class TotalMemoryMonitor implements Monitor { 24 | 25 | @Override 26 | public Stat getStat() { 27 | Stat stat = new Stat(new Long(Runtime.getRuntime().totalMemory())); 28 | return stat; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/ResultValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.result; 20 | 21 | /** 22 | * Generic box container for a result value. This class allows for writing results of any type easily 23 | * 24 | * @param 25 | */ 26 | public class ResultValue { 27 | T resultValue; 28 | 29 | public ResultValue(T resultValue) { 30 | this.resultValue = resultValue; 31 | } 32 | 33 | public T getResultValue() { 34 | return resultValue; 35 | } 36 | 37 | @Override public String toString() { 38 | return resultValue.toString(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/result/file/Extension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf.result.file; 20 | 21 | public enum Extension { 22 | CSV(".csv"), 23 | XML(".xml"), 24 | VISUALIZATION(".jpg"), 25 | AGGREGATE_CSV("_aggregate" + CSV), 26 | DETAILED_CSV("_detail" + CSV); 27 | 28 | private String extension; 29 | 30 | private Extension(String extension) { 31 | this.extension = extension; 32 | } 33 | 34 | @Override public String toString() { 35 | return extension; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/Workload.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.pherf.workload; 19 | 20 | public interface Workload { 21 | public Runnable execute() throws Exception; 22 | 23 | /** 24 | * Use this method to perform any cleanup or forced shutdown of the thread. 25 | */ 26 | public void complete(); 27 | } 28 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/resources/datamodel/create_prod_test_unsalted.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */ 18 | 19 | CREATE TABLE IF NOT EXISTS PHERF.PHERF_PROD_TEST_UNSALTED ( 20 | TENANT_ID CHAR(15) NOT NULL, 21 | CREATED_DATE DATE NOT NULL, 22 | FIELD VARCHAR, 23 | DATA_TYPE VARCHAR, 24 | OLDVAL_STRING VARCHAR, 25 | NEWVAL_STRING VARCHAR, 26 | DIVISION INTEGER, 27 | CONNECTION_ID VARCHAR 28 | CONSTRAINT PK PRIMARY KEY 29 | ( 30 | TENANT_ID, 31 | CREATED_DATE DESC 32 | ) 33 | ) VERSIONS=1,MULTI_TENANT=true 34 | -------------------------------------------------------------------------------- /phoenix-pherf/src/main/resources/hbase-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | phoenix.query.threadPoolSize 23 | 128 24 | 25 | 26 | -------------------------------------------------------------------------------- /phoenix-pherf/src/test/java/org/apache/phoenix/pherf/TestHBaseProps.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package org.apache.phoenix.pherf; 20 | 21 | import static org.junit.Assert.*; 22 | 23 | import org.apache.hadoop.conf.Configuration; 24 | import org.apache.hadoop.hbase.HBaseConfiguration; 25 | import org.junit.Test; 26 | 27 | public class TestHBaseProps { 28 | 29 | @Test 30 | public void testCheckHBaseProps(){ 31 | Configuration conf = HBaseConfiguration.create(); 32 | assertTrue("did not get correct threadpool size", conf.get("phoenix.query.threadPoolSize").equals("128")); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /phoenix-pherf/src/test/resources/datamodel/test_schema.sql: -------------------------------------------------------------------------------- 1 | /* 2 | -- Licensed to the Apache Software Foundation (ASF) under one 3 | -- or more contributor license agreements. See the NOTICE file 4 | -- distributed with this work for additional information 5 | -- regarding copyright ownership. The ASF licenses this file 6 | -- to you under the Apache License, Version 2.0 (the 7 | -- "License"); you may not use this file except in compliance 8 | -- with the License. You may obtain a copy of the License at 9 | -- 10 | -- http://www.apache.org/licenses/LICENSE-2.0 11 | -- 12 | -- Unless required by applicable law or agreed to in writing, software 13 | -- distributed under the License is distributed on an "AS IS" BASIS, 14 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | -- See the License for the specific language governing permissions and 16 | -- limitations under the License. 17 | */ 18 | CREATE TABLE IF NOT EXISTS PHERF.TEST_TABLE ( 19 | TENANT_ID CHAR(15) NOT NULL, 20 | PARENT_ID CHAR(15) NOT NULL, 21 | CREATED_DATE DATE NOT NULL, 22 | FIELD VARCHAR, 23 | OLDVAL_STRING VARCHAR, 24 | NEWVAL_STRING VARCHAR, 25 | SOME_INT INTEGER 26 | CONSTRAINT PK PRIMARY KEY 27 | ( 28 | TENANT_ID, 29 | PARENT_ID, 30 | CREATED_DATE DESC 31 | ) 32 | ) VERSIONS=1,MULTI_TENANT=true 33 | -------------------------------------------------------------------------------- /phoenix-pherf/src/test/resources/datamodel/test_schema_mt_table.sql: -------------------------------------------------------------------------------- 1 | /* 2 | -- Licensed to the Apache Software Foundation (ASF) under one 3 | -- or more contributor license agreements. See the NOTICE file 4 | -- distributed with this work for additional information 5 | -- regarding copyright ownership. The ASF licenses this file 6 | -- to you under the Apache License, Version 2.0 (the 7 | -- "License"); you may not use this file except in compliance 8 | -- with the License. You may obtain a copy of the License at 9 | -- 10 | -- http://www.apache.org/licenses/LICENSE-2.0 11 | -- 12 | -- Unless required by applicable law or agreed to in writing, software 13 | -- distributed under the License is distributed on an "AS IS" BASIS, 14 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | -- See the License for the specific language governing permissions and 16 | -- limitations under the License. 17 | */ 18 | CREATE TABLE IF NOT EXISTS PHERF.TEST_MULTI_TENANT_TABLE ( 19 | TENANT_ID CHAR(15) NOT NULL, 20 | IDENTIFIER CHAR(3) NOT NULL, 21 | ID CHAR(15) NOT NULL, 22 | CREATED_DATE DATE, 23 | FIELD VARCHAR, 24 | SOME_INT INTEGER 25 | CONSTRAINT PK PRIMARY KEY 26 | ( 27 | TENANT_ID, 28 | IDENTIFIER, 29 | ID 30 | ) 31 | ) VERSIONS=1,MULTI_TENANT=true 32 | -------------------------------------------------------------------------------- /phoenix-pherf/src/test/resources/hbase-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 22 | phoenix.query.threadPoolSize 23 | 128 24 | 25 | 26 | -------------------------------------------------------------------------------- /phoenix-pherf/standalone/pherf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | source config/env.sh 20 | PHERF_HOME=$(cd "`dirname $0`" && pwd) 21 | CLASSPATH=${PHERF_HOME}/config:${CLASSPATH} 22 | 23 | for f in $PHERF_HOME/lib/*.jar; do 24 | CLASSPATH=${CLASSPATH}:$f; 25 | done 26 | 27 | CMD="time ${JAVA_HOME}/bin/java ${REMOTE_DEBUG} -Dapp.home=${PHERF_HOME} ${ENV_PROPS} -Xms512m -Xmx3072m -cp ${CLASSPATH} org.apache.phoenix.pherf.Pherf ${@}" 28 | eval $CMD -------------------------------------------------------------------------------- /phoenix-protocol/README.txt: -------------------------------------------------------------------------------- 1 | These are the protobuf definition files. The produced java classes are generated into 2 | phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated. Please check them in so no need 3 | to recreate them in every build. 4 | 5 | To regenerate the classes after making definition file changes, ensure first that 6 | the protobuf protoc(at least 2.5) tool is in your $PATH (You may need to download it and build 7 | it first; its part of the protobuf package obtainable from here: 8 | http://code.google.com/p/protobuf/downloads/list). 9 | 10 | Goto folder phoenix-protocol/src/main and run "./build-proto.sh" 11 | -------------------------------------------------------------------------------- /phoenix-protocol/src/main/PGuidePosts.proto: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | option java_package = "org.apache.phoenix.coprocessor.generated"; 22 | option java_outer_classname = "PGuidePostsProtos"; 23 | option java_generic_services = true; 24 | option java_generate_equals_and_hash = true; 25 | option optimize_for = SPEED; 26 | message PGuidePosts { 27 | repeated bytes guidePosts = 1; 28 | optional int64 byteCount = 2; 29 | optional int64 rowCount = 3; 30 | } -------------------------------------------------------------------------------- /phoenix-protocol/src/main/ServerCacheFactory.proto: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | option java_package = "org.apache.phoenix.coprocessor.generated"; 22 | option java_outer_classname = "ServerCacheFactoryProtos"; 23 | option java_generic_services = true; 24 | option java_generate_equals_and_hash = true; 25 | option optimize_for = SPEED; 26 | 27 | message ServerCacheFactory { 28 | required string className = 1; 29 | } 30 | -------------------------------------------------------------------------------- /phoenix-protocol/src/main/build-proto.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | ## 19 | # script to run protoc to generate protocol buf files 20 | # run the script under folder src/protocol 21 | # usage: ./build-proto.sh 22 | # 23 | 24 | which protoc 25 | if [ $? != 0 ] ; then 26 | echo "Must have protoc compiler in your path to generate code" 27 | exit 1 28 | fi 29 | 30 | PROTO_ROOT_DIR=`dirname $0` 31 | PROTO_DIR=$PROTO_ROOT_DIR 32 | JAVA_DIR=$PROTO_ROOT_DIR/../../../phoenix-core/src/main/java 33 | 34 | set -x 35 | for f in $PROTO_DIR/*.proto ; do 36 | protoc -I$PROTO_DIR --java_out=$JAVA_DIR $f 37 | done 38 | -------------------------------------------------------------------------------- /phoenix-server-client/src/main/java/org/apache/phoenix/queryserver/client/ThinClientUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.queryserver.client; 19 | 20 | /** 21 | * Utilities for thin clients. 22 | */ 23 | public final class ThinClientUtil { 24 | 25 | private ThinClientUtil() {} 26 | 27 | public static String getConnectionUrl(String hostname, int port) { 28 | return getConnectionUrl("http", hostname, port); 29 | } 30 | 31 | public static String getConnectionUrl(String protocol, String hostname, int port) { 32 | String urlFmt = Driver.CONNECT_STRING_PREFIX + "url=%s://%s:%s"; 33 | return String.format(urlFmt, protocol, hostname, port); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phoenix-server-client/src/main/resources/META-INF/services/java.sql.Driver: -------------------------------------------------------------------------------- 1 | org.apache.phoenix.queryserver.client.Driver 2 | -------------------------------------------------------------------------------- /phoenix-server-client/src/main/resources/version/org-apache-phoenix-remote-jdbc.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to you under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | driver.name=Apache Phoenix Remote JDBC Driver 17 | driver.version=${pom.version} 18 | product.name=Apache Phoenix 19 | product.version=${pom.version} 20 | jdbc.compliant=true 21 | driver.version.major=${version.major} 22 | driver.version.minor=${version.minor} 23 | database.version.major=${version.major} 24 | database.version.minor=${version.minor} 25 | build.timestamp=${build.timestamp} 26 | -------------------------------------------------------------------------------- /phoenix-server/src/main/java/org/apache/phoenix/queryserver/server/PhoenixMetaFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | package org.apache.phoenix.queryserver.server; 19 | 20 | import org.apache.calcite.avatica.Meta; 21 | import org.apache.hadoop.conf.Configurable; 22 | 23 | /** 24 | * A @{link Meta.Factory} that can also respect Hadoop 25 | * {@link org.apache.hadoop.conf.Configuration} objects. 26 | */ 27 | public interface PhoenixMetaFactory extends Meta.Factory, Configurable { 28 | } 29 | -------------------------------------------------------------------------------- /phoenix-spark/src/main/scala/org/apache/phoenix/spark/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | package org.apache.phoenix 15 | 16 | import org.apache.spark.SparkContext 17 | import org.apache.spark.rdd.RDD 18 | import org.apache.spark.sql.{DataFrame, SQLContext} 19 | 20 | package object spark { 21 | implicit def toProductRDDFunctions[A <: Product](rdd: RDD[A]): ProductRDDFunctions[A] = { 22 | new ProductRDDFunctions[A](rdd) 23 | } 24 | 25 | implicit def toSparkContextFunctions(sc: SparkContext): SparkContextFunctions = { 26 | new SparkContextFunctions(sc) 27 | } 28 | 29 | implicit def toSparkSqlContextFunctions(sqlContext: SQLContext): SparkSqlContextFunctions = { 30 | new SparkSqlContextFunctions(sqlContext) 31 | } 32 | 33 | implicit def toDataFrameFunctions(data: DataFrame): DataFrameFunctions = { 34 | new DataFrameFunctions(data) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/README.md: -------------------------------------------------------------------------------- 1 | # TracingWebApp 2 | 1. Build the web application- 3 | *mvn clean install* 4 | 5 | 2. Start the TracingWebApp 6 | *java -jar target/phoenix-tracing-webapp-4.5.0-SNAPSHOT-runnable.jar* 7 | 8 | 3. View the Content - 9 | *http://localhost:8864/webapp/#* 10 | 11 | ###Note 12 | You can set the port of the trace app by -Dphoenix.traceserver.http.port={portNo} 13 | 14 | eg: 15 | `-Dphoenix.traceserver.http.port=8887` server will start in 8887 16 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/config/checkstyle/header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Trace 9 | org.apache.phoenix.tracingwebapp.http.TraceServlet 10 | 11 | 12 | Trace 13 | /trace/* 14 | 15 | 16 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chiastic-security/phoenix-for-cloudera/eb3786268823aa791f5126385c98dfd6f80c348a/phoenix-tracing-webapp/src/main/webapp/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/js/config/chart-config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | angular.module('TimeLineCtrl') 4 | .constant('chartModels', { 5 | 'timeLineModel': { 6 | "type": "Timeline", 7 | "displayed": true, 8 | "data": { 9 | "cols": [{ 10 | "id": "TraceID", 11 | "label": "TraceID", 12 | "type": "string", 13 | "p": {} 14 | }, { 15 | "id": "Label", 16 | "label": "Label", 17 | "type": "string", 18 | "p": {} 19 | }, { 20 | "id": "Start", 21 | "label": "Start", 22 | "type": "date", 23 | "p": {} 24 | }, { 25 | "id": "End", 26 | "label": "End", 27 | "type": "date", 28 | "p": {} 29 | }], 30 | "rows": [{ 31 | "c": [{ 32 | "v": "Trace 01" 33 | }, { 34 | "v": "Writing mutation batch for table: MY_TABLE1" 35 | }, { 36 | "v": new Date(1434196101623) 37 | }, { 38 | "v": new Date(1434196101784) 39 | }] 40 | }] 41 | }, 42 | "options": {}, 43 | "formatters": {} 44 | } 45 | }); -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/js/controllers/accordion-controllers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var UICtrl = angular.module('UICtrl', ['ui.bootstrap']); 4 | UICtrl.controller('AccordionDemoCtrl', function($scope) { 5 | $scope.oneAtATime = true; 6 | 7 | $scope.groups = [ 8 | { 9 | title: 'Dynamic Group Header - 1', 10 | content: 'Dynamic Group Body - 1' 11 | }, 12 | { 13 | title: 'Dynamic Group Header - 2', 14 | content: 'Dynamic Group Body - 2' 15 | } 16 | ]; 17 | 18 | $scope.items = ['Item 1', 'Item 2', 'Item 3']; 19 | 20 | $scope.addItem = function() { 21 | var newItemNo = $scope.items.length + 1; 22 | $scope.items.push('Item ' + newItemNo); 23 | }; 24 | 25 | $scope.status = { 26 | isFirstOpen: true, 27 | isFirstDisabled: false 28 | }; 29 | }); 30 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/js/controllers/list-controllers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var TraceCtrl = angular.module('TracingCtrl', ['googlechart', 'ui.bootstrap']); 4 | 5 | //listing trace from json 6 | TraceCtrl.controller('TraceListCtrl', function($scope, $http) { 7 | //$scope.traces = sampleTrace; 8 | $scope.traces = []; 9 | $scope.tracesLimit =100; 10 | $scope.letterLimit =100; 11 | $scope.loadTrace = function() { 12 | var httpRequest = $http({ 13 | method: 'GET', 14 | url: '../trace?action=getall&limit='+$scope.tracesLimit 15 | 16 | }).success(function(data, status) { 17 | $scope.traces = data; 18 | }); 19 | 20 | }; 21 | $scope.loadTrace(); 22 | }); -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/js/controllers/trace-count-controllers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | TraceCtrl.controller('TraceCountChartCtrl', function($scope,$http) { 4 | $scope.page = { 5 | title: 'Trace Count Chart Graph' 6 | }; 7 | $scope.loadData = function() { 8 | console.log('data is loading for getCount'); 9 | $http.get('../trace/?action=getCount'). 10 | success(function(data, status, headers, config) { 11 | console.log('recived the data'); 12 | console.log(data); 13 | for(var i = 0; i < data.length; i++) { 14 | var datax = data[i]; 15 | var datamodel =[{ 16 | "v": datax.description 17 | }, { 18 | "v": parseFloat(datax.count) 19 | }] 20 | chartObject.data.rows[i] = {"c": datamodel} 21 | chartObject.options.width = '800'; 22 | chartObject.options.hAxis.title = 'Traces'; 23 | } 24 | }). 25 | error(function(data, status, headers, config) { 26 | console.log('error of loading timeline in start'); 27 | }); 28 | 29 | $scope.chartObject = chartObject; 30 | }; 31 | 32 | $scope.setChartType = function(type) { 33 | $scope.chartObject.type = type; 34 | }; 35 | 36 | $scope.chartObject = {}; 37 | $scope.loadData(); 38 | $scope.chartObject.type = "ColumnChart"; 39 | 40 | }); -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/js/controllers/trace-distribution-controllers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | TraceCtrl.controller('TraceDistChartCtrl', function($scope, $http) { 4 | 5 | $scope.page = { 6 | title: 'Trace Distribution' 7 | }; 8 | $scope.loadData = function() { 9 | console.log('data is loading for getDistribution'); 10 | $http.get('../trace/?action=getDistribution'). 11 | success(function(data, status, headers, config) { 12 | console.log('recived the data'); 13 | console.log(data); 14 | for(var i = 0; i < data.length; i++) { 15 | var datax = data[i]; 16 | var datamodel =[{ 17 | "v": datax.hostname 18 | }, { 19 | "v": parseFloat(datax.count) 20 | }] 21 | chartObject.data.rows[i] = {"c": datamodel 22 | } 23 | } 24 | }). 25 | error(function(data, status, headers, config) { 26 | console.log('error of loading timeline in start'); 27 | }); 28 | 29 | $scope.chartObject = chartObject; 30 | }; 31 | 32 | $scope.setChartType = function(type) { 33 | $scope.chartObject.type = type; 34 | }; 35 | 36 | $scope.chartObject = {}; 37 | $scope.loadData(); 38 | //$scope.chartObject = chartObject 39 | }); -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/js/factories/statement-factory-config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | /** 3 | * @ngdoc function 4 | * @name TracingAppCtrl.statment configure 5 | * @description 6 | * # configures will contains the configure for statement factory. 7 | * 8 | */ 9 | angular.module('TracingAppCtrl') 10 | .constant('stateConfig', { 11 | 'command': {'select': 'FULL SCAN OVER '}, 12 | 'start': 'Creating basic query for [', 13 | 'end': ']' 14 | }); -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/js/factories/statement-factory.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * SQL Convert Statement Factory 5 | * 6 | */ 7 | 8 | angular.module('TracingAppCtrl').factory('StatementFactory', function(stateConfig) { 9 | 10 | var StatementFactory = function(command,tableName) { 11 | this.start = stateConfig.start; 12 | this.command = stateConfig.command[command]; 13 | this.tableName = tableName; 14 | this.filters = {}; 15 | this.groupBy = {}; 16 | this.keys = {}; 17 | this.end = stateConfig.end; 18 | }; 19 | 20 | StatementFactory.setKeys = function(keys) { 21 | ChartFactory.keys = keys; 22 | }; 23 | 24 | StatementFactory.setCommands = function(command) { 25 | ChartFactory.command = command; 26 | }; 27 | 28 | return StatementFactory; 29 | }); -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/partials/about.html: -------------------------------------------------------------------------------- 1 |

2 |

About

3 |
4 | 5 | 6 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/partials/chart.html: -------------------------------------------------------------------------------- 1 |
2 |

{{page.title}}

3 |
4 | 5 |
6 | 7 | 8 | 9 | Controller Panel 10 | 11 | 12 |
13 |
14 |
15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 |
24 |
-------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/partials/contact.html: -------------------------------------------------------------------------------- 1 |
2 |

Contacts

3 |
4 | 5 | 6 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/partials/dependency-tree.html: -------------------------------------------------------------------------------- 1 |
2 |

{{page.title}}

3 |
4 | 5 | 10 | 11 |
-------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/partials/google-chart.html: -------------------------------------------------------------------------------- 1 |
2 |

{{page.title}}

3 |
4 | 5 |
6 |
Trace Picker
7 |
8 |
9 |
13 |
14 | 16 |
17 |
18 | 19 | 20 |
21 |
22 |
23 |
-------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/partials/help.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Help

4 |
5 | 6 | 7 | 37 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/partials/home.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Phoenix Tracing

4 |

You have more interaction with Phoenix Tracing. This User Interface allows you to see and search each important step in a query or insertion, 5 | all they way from the client through into the HBase side, and back again.

6 |
7 | 21 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/main/webapp/partials/list.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

Phoenix Tracing List

4 |
5 | 6 | 7 | 40 | -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/test/webapp/js/specs/timeline-ctrl-spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | describe('Controller : TimeLineCtrl', function() { 5 | /* 6 | beforeEach(module('TimeLineCtrl')); 7 | 8 | beforeEach(inject(function($rootScope, $controller) { 9 | scope = $rootScope.$new(); 10 | traceTimeLineCtrl = $controller('TraceTimeLineCtrl', { 11 | $scope: scope 12 | }); 13 | })); 14 | 15 | 16 | 17 | it('should to be defined', function() { 18 | expect(scope).toBeDefined(); 19 | }); 20 | 21 | it('scope level variable should to be defined', function() { 22 | expect(scope.chartObject).toBeDefined(); 23 | expect(scope.loadTimeLine).toBeDefined(); 24 | expect(scope.clear).toBeDefined(); 25 | }); 26 | */ 27 | }); -------------------------------------------------------------------------------- /phoenix-tracing-webapp/src/test/webapp/js/specs/tracing-app-ctrl-spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | //beforeEach(module('TracingAppCtrl')); 5 | describe('The Tracing Web App ', function() { 6 | 7 | describe('Controller: TracingAppCtrl', function() { 8 | 9 | // load the controller's module 10 | beforeEach(module('TracingAppCtrl')); 11 | 12 | 13 | //testing all the main controllers in app 14 | var TraceListCtrl, scope; 15 | it('Controllers should to be defined', function() { 16 | expect(TraceCtrl).toBeDefined(); 17 | expect(UICtrl).toBeDefined(); 18 | expect(TimeLineCtrl).toBeDefined(); 19 | expect(SearchCtrl).toBeDefined(); 20 | }); 21 | }); 22 | 23 | }); -------------------------------------------------------------------------------- /src/main/config/checkstyle/header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to you under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | --------------------------------------------------------------------------------