Skip to content

Commit

Permalink
Moving build system to maven
Browse files Browse the repository at this point in the history
Added a build.txt to help explain usage.

The tests, antlr and build stuff has been moved into the standard mvn structure (src/...), but
the rest of the source is still in java/src. For right now the build system is fine with it, but it should
also be moved at some point soon. Also, removed all the .project/.settings/.classpath files since
maven import into eclipse makes that work correctly without messing with that stuff.

I'm leaving the build/ directory for the moment, until we are sure mvn works, but it should also
go away soon (when we are confident).

Additionally, adding .gitignore that's correct for maven
  • Loading branch information
jyates committed Jan 26, 2013
1 parent c6ef10c commit 511538a
Show file tree
Hide file tree
Showing 84 changed files with 1,653 additions and 112 deletions.
10 changes: 0 additions & 10 deletions .classpath

This file was deleted.

12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#general java
*.class
*.war
*.jar

# eclipse stuffs
.settings/*
.classpath
.project

#maven stuffs
target/
18 changes: 0 additions & 18 deletions .project

This file was deleted.

8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ To install a pre-built phoenix, use these directions
* [phoenix.jar](http://forcedotcom.github.com/Phoenix/lib/phoenix.jar)
* [phoenix-client.jar](http://forcedotcom.github.com/Phoenix/lib/phoenix-client.jar)
* Add the phoenix.jar to the classpath of every HBase region server. An easy way to do this is to copy it into the HBase lib directory.
* Restart all region servers.
* Add the phoenix-client.jar to the classpath of any Phoenix client. This jar includes the minimum set of required HBase jars, along with the following required phoenix jars
* phoenix.jar
* antlr-3.2.jar
* opencsv-2.3.jar

Alternatively, you can build it yourself by following these [build instructions](https://github.com/forcedotcom/Phoenix/wiki#building).

Expand All @@ -51,7 +51,7 @@ One way to experiment with Phoenix is to download and install a SQL client such
3. In Add Driver dialog box, set Name to Phoenix
4. Press List Drivers button and jdbc.PhoenixProdEmbeddedDriver should be automatically populated in Class Name textbox. Press OK to close this dialog.
5. Switch to Alias tab and create new Alias (Aliases -> New Aliases)
6. In the dialog box, Name: <any name>, Driver: Phoenix, User Name: <anything>, Password: <anything>
6. In the dialog box, Name: <any name>, Driver: Phoenix, User Name: _anything_, Password: _anything_
7. Construct URL as follows: jdbc:phoenix:<zookeeper quorum server>. For example, to connect to a local HBase use: jdbc:phoenix:localhost
8. Press Test (which should succeed if everything is setup correctly) and press OK to close.
9. Now double click on your newly created Phoenix alias and click Connect. Now you are ready to run SQL queries against Phoenix.
Expand All @@ -67,5 +67,7 @@ In addition, several basic shell scripts are provided to allow for direct SQL ex
The best place to see samples are in our unit tests under test/func/java. These are end-to-end tests demonstrating how to use all aspects of the Phoenix JDBC driver.

##Mailing List##
Join our [Phoenix HBase](https://groups.google.com/forum/#!forum/phoenix-hbase) Google group and let us know if you have ideas or run into problems.
Join one or both of our Google groups:
* [Phoenix HBase User](https://groups.google.com/forum/#!forum/phoenix-hbase-user) for users of Phoenix.
* [Phoenix HBase Dev](https://groups.google.com/forum/#!forum/phoenix-hbase-dev) for developers of Phoenix.

29 changes: 29 additions & 0 deletions build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Building Phoenix
================

Phoenix uses Maven (3.X) to build all its necessary resources.

## Building from source
=======================

1. To re-generate the antrl based files:
$ mvn generate-sources

2. To build the jars
$ mvn package
and optionally, to just skip all the tests and build the jars:
$ mvn package -DskipTests

3.

## Importing into eclipse
=========================

Use the m2e eclipse plugin and do Import->Maven Project and just pick the root 'phoenix' directory.

## Running the tests
====================

1. All tests
$ mvn clean test

20 changes: 9 additions & 11 deletions build/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,23 @@
# production needs alternate values.
#

# Phoenix install location. Example /tmp/phoenix
devhome.dir = SPECIFY_YOUR_PHOENIX_SOURCE_ROOT_LOCATION_HERE
# Match following with your ANT install location.
# You can set ANT_HOME location here by uncommenting the following line or
# setting environment variable. Example: export ANT_HOME=/home/user/apache-ant-1.8.0
# ANT_HOME = SPECIFY_YOUR_ANT_HOME_LOCATION_HERE

# Match following with your ANT install location
ANT_HOME = /YOUR_ANT_LOCATION_HERE/apache-ant-1.8.0

# Location of your m2_repo excluding your home folder
# Location of your m2_repo excluding your home folder path
M2_REPO = .m2/repository

# The java implementation to use. Java 1.6 required.
# JAVA_HOME=/usr/java/jdk1.6.0/
# The java implementation to use. Java 1.6 or higher required.
# You can set JAVA_HOME location here by uncommenting the following line or
# setting environment variable. Example: export JAVA_HOME=/usr/java/jdk1.6.0/
# JAVA_HOME = SPECIFY_YOUR_JAVA_HOME_LOCATION_HERE

# HBase specific variables. You should not need to modify the following.
hbase-revision = 1395367
hbase.version = hbase-0.94.2
hbase.url = http://svn.apache.org/repos/asf/hbase/branches/0.94
hbase.root = ${devhome.dir}/../hbase
hbase.home = ${hbase.root}/target/${hbase.version}/${hbase.version}
hbase.lib = ${hbase.home}/lib

ANT_GC_ARGS = -Xmx2048m

5 changes: 4 additions & 1 deletion java/src/phoenix/compile/DeleteCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
import phoenix.iterate.ResultIterator;
import phoenix.jdbc.PhoenixConnection;
import phoenix.parse.*;
import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.QueryConstants;
import phoenix.query.QueryServices;
import phoenix.query.QueryServicesOptions;
import phoenix.query.Scanner;
import phoenix.schema.*;
import phoenix.schema.tuple.Tuple;
Expand Down
4 changes: 3 additions & 1 deletion java/src/phoenix/compile/UpsertCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
import phoenix.iterate.ResultIterator;
import phoenix.jdbc.*;
import phoenix.parse.*;
import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.QueryServices;
import phoenix.query.QueryServicesOptions;
import phoenix.query.Scanner;
import phoenix.schema.*;
import phoenix.schema.tuple.Tuple;
Expand Down
4 changes: 3 additions & 1 deletion java/src/phoenix/execute/AggregatePlan.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
import phoenix.expression.Expression;
import phoenix.expression.aggregator.Aggregators;
import phoenix.iterate.*;
import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.Scanner;
import phoenix.query.WrappedScanner;
import phoenix.schema.TableRef;


Expand Down
4 changes: 3 additions & 1 deletion java/src/phoenix/execute/BasicQueryPlan.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
import phoenix.compile.*;
import phoenix.compile.OrderByCompiler.OrderBy;
import phoenix.jdbc.PhoenixConnection;
import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.DegenerateScanner;
import phoenix.query.Scanner;
import phoenix.schema.TableRef;
import phoenix.util.ScanUtil;

Expand Down
5 changes: 4 additions & 1 deletion java/src/phoenix/execute/ScanPlan.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
import phoenix.compile.*;
import phoenix.coprocessor.ScanRegionObserver;
import phoenix.iterate.*;
import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.QueryConstants;
import phoenix.query.Scanner;
import phoenix.query.WrappedScanner;
import phoenix.schema.TableRef;


Expand Down
5 changes: 4 additions & 1 deletion java/src/phoenix/iterate/ParallelIterators.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
import phoenix.execute.RowCounter;
import phoenix.job.JobManager.JobCallable;
import phoenix.memory.MemoryManager;
import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.KeyRange;
import phoenix.query.QueryServices;
import phoenix.query.QueryServicesOptions;
import phoenix.schema.TableRef;
import phoenix.util.SQLCloseables;
import phoenix.util.ScanUtil;
Expand Down
6 changes: 5 additions & 1 deletion java/src/phoenix/jdbc/PhoenixConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@

import phoenix.execute.MutationState;
import phoenix.jdbc.PhoenixStatement.PhoenixStatementParser;
import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.MetaDataMutated;
import phoenix.query.QueryConstants;
import phoenix.query.QueryServices;
import phoenix.query.QueryServicesOptions;
import phoenix.schema.*;
import phoenix.util.*;

Expand Down
4 changes: 3 additions & 1 deletion java/src/phoenix/jdbc/PhoenixDatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
import phoenix.expression.RowKeyColumnExpression;
import phoenix.expression.function.SqlTypeNameFunction;
import phoenix.iterate.*;
import phoenix.query.*;
import phoenix.query.DelegateScanner;
import phoenix.query.QueryConstants;
import phoenix.query.Scanner;
import phoenix.query.WrappedScanner;
import phoenix.schema.*;
import phoenix.schema.tuple.SingleKeyValueTuple;
import phoenix.schema.tuple.Tuple;
Expand Down
3 changes: 2 additions & 1 deletion java/src/phoenix/jdbc/PhoenixEmbeddedDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
import java.util.Properties;
import java.util.logging.Logger;

import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.QueryServices;
import phoenix.util.PhoenixRuntime;
import phoenix.util.SQLCloseable;

Expand Down
5 changes: 4 additions & 1 deletion java/src/phoenix/jdbc/PhoenixProdEmbeddedDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;

import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.ConnectionQueryServicesImpl;
import phoenix.query.ConnectionlessQueryServicesImpl;
import phoenix.query.QueryServicesImpl;
import phoenix.util.SQLCloseables;

/**
Expand Down
4 changes: 3 additions & 1 deletion java/src/phoenix/jdbc/PhoenixStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
import phoenix.expression.RowKeyColumnExpression;
import phoenix.iterate.MaterializedResultIterator;
import phoenix.parse.*;
import phoenix.query.*;
import phoenix.query.QueryConstants;
import phoenix.query.QueryServices;
import phoenix.query.Scanner;
import phoenix.query.WrappedScanner;
import phoenix.schema.*;
import phoenix.schema.tuple.SingleKeyValueTuple;
import phoenix.schema.tuple.Tuple;
Expand Down
3 changes: 2 additions & 1 deletion java/src/phoenix/join/HashCacheClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
import phoenix.iterate.ResultIterator;
import phoenix.job.JobManager.JobCallable;
import phoenix.memory.MemoryManager.MemoryChunk;
import phoenix.query.*;
import phoenix.query.ConnectionQueryServices;
import phoenix.query.QueryServices;
import phoenix.query.Scanner;
import phoenix.schema.tuple.Tuple;
import phoenix.util.*;
Expand Down
4 changes: 2 additions & 2 deletions java/src/phoenix/query/StatsManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ public StatsManagerImpl(ConnectionQueryServices services, int statsUpdateFrequen
this(services, statsUpdateFrequencyMs, maxStatsAgeMs, TimeKeeper.SYSTEM);
}

StatsManagerImpl(ConnectionQueryServices services, int statsUpdateFrequencyMs, int maxStatsAgeMs, TimeKeeper timeKeeper) {
public StatsManagerImpl(ConnectionQueryServices services, int statsUpdateFrequencyMs, int maxStatsAgeMs, TimeKeeper timeKeeper) {
this.services = services;
this.statsUpdateFrequencyMs = statsUpdateFrequencyMs;
this.maxStatsAgeMs = maxStatsAgeMs;
this.timeKeeper = timeKeeper;
}

static interface TimeKeeper {
public static interface TimeKeeper {
static final TimeKeeper SYSTEM = new TimeKeeper() {
@Override
public long currentTimeMillis() {
Expand Down
Loading

0 comments on commit 511538a

Please sign in to comment.