This repository has been archived by the owner on Jan 23, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactors client materials moving them from "pig" to "client" module
Also: - Replaces ./bin/ambrose-package with `mvn package` - Adds Eclipse Jetty to ambrose-pig deps and removes references to Hadoop installation materials from pig-ambrose invocation script - Adds demo pig script and data to amrbose-pig - Updates ambrose-demo script to work with new client web resources location - Updates README.md quick start text
- Loading branch information
1 parent
b41546c
commit a65ce09
Showing
27 changed files
with
221 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.twitter.ambrose</groupId> | ||
<artifactId>ambrose</artifactId> | ||
<version>0.1.0-SNAPSHOT</version> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
|
||
<groupId>com.twitter.ambrose</groupId> | ||
<artifactId>ambrose-client</artifactId> | ||
<version>0.1.0-SNAPSHOT</version> | ||
<name>Ambrose Client</name> | ||
|
||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> | ||
<id>bin</id> | ||
<formats> | ||
<format>tar.gz</format> | ||
</formats> | ||
|
||
<fileSets> | ||
<!-- scripts --> | ||
<fileSet> | ||
<directory>src/main/scripts</directory> | ||
<outputDirectory>bin</outputDirectory> | ||
<fileMode>0755</fileMode> | ||
<includes> | ||
<include>*</include> | ||
</includes> | ||
</fileSet> | ||
|
||
<!-- demo --> | ||
<fileSet> | ||
<directory>src/main/demo</directory> | ||
<outputDirectory>demo</outputDirectory> | ||
<includes> | ||
<include>*</include> | ||
</includes> | ||
</fileSet> | ||
|
||
<!-- documentation from parent --> | ||
<fileSet> | ||
<directory>${project.basedir}/..</directory> | ||
<outputDirectory>/</outputDirectory> | ||
<includes> | ||
<include>README*</include> | ||
<include>LICENSE*</include> | ||
<include>NOTICE*</include> | ||
<include>docs/**/*</include> | ||
</includes> | ||
</fileSet> | ||
</fileSets> | ||
|
||
<files> | ||
<!-- documentation --> | ||
<file> | ||
<source>README.md</source> | ||
<outputDirectory>/</outputDirectory> | ||
<destName>README-PIG.md</destName> | ||
</file> | ||
</files> | ||
|
||
<!-- jars --> | ||
<dependencySets> | ||
<dependencySet> | ||
<outputDirectory>lib</outputDirectory> | ||
<includes> | ||
<include>*:ambrose-client</include> | ||
<include>*:ambrose-pig</include> | ||
<include>org.apache.pig:pig</include> | ||
<include>org.eclipse.jetty.aggregate:jetty-webapp</include> | ||
</includes> | ||
<useTransitiveDependencies>false</useTransitiveDependencies> | ||
</dependencySet> | ||
</dependencySets> | ||
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
1 John {(2),(3)} {(4)} | ||
2 Mary {(1),(3)} {} | ||
3 Mike {(1),(2),(4)} {} | ||
4 Jane {(3),(4)} {(1)} | ||
5 Andy {} {(5)} | ||
6 Unicorn Sparklepants {(1),(2),(3),(4),(5)} {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Demo pig script for use with pig-ambrose. Reads some data and does some stuff. | ||
*/ | ||
|
||
%default BASEDIR `pwd`; | ||
%default INPUT_PATH 'file://$BASEDIR/demo'; | ||
%default OUTPUT_PATH 'file://$BASEDIR/demo/output'; | ||
|
||
user = LOAD '$INPUT_PATH/data.tsv' AS ( | ||
user_id: long, name: chararray, friends: {(user_id: long)}, enemies: {(user_id: long)} | ||
); | ||
|
||
user_counts = FOREACH user GENERATE | ||
user_id, COUNT(friends) AS num_friends, COUNT(enemies) AS num_enemies; | ||
|
||
friends_users_histogram = FOREACH (GROUP user_counts BY num_friends) GENERATE | ||
group AS friends, COUNT(user_counts) AS users; | ||
|
||
enemies_users_histogram = FOREACH (GROUP user_counts BY num_enemies) GENERATE | ||
group AS enemies, COUNT(user_counts) AS users; | ||
|
||
narcissists = FOREACH user GENERATE user_id, name, FLATTEN(friends) AS (friend_id); | ||
narcissists = FILTER narcissists BY user_id == friend_id; | ||
narcissists = FOREACH narcissists GENERATE user_id, name; | ||
|
||
masochists = FOREACH user GENERATE user_id, name, FLATTEN(enemies) AS (enemy_id); | ||
masochists = FILTER masochists BY user_id == enemy_id; | ||
masochists = FOREACH masochists GENERATE user_id, name; | ||
|
||
user_enemy = FOREACH user GENERATE user_id, name, FLATTEN(enemies) AS (enemy_id); | ||
user_enemy2 = FOREACH user_enemy GENERATE user_id, enemy_id; | ||
user_enemy_enemy = FOREACH ( | ||
JOIN user_enemy BY enemy_id, user_enemy2 BY user_id | ||
) GENERATE user_enemy::user_id AS user_id, user_enemy::name AS name, | ||
user_enemy2::enemy_id AS enemy_enemy_id; | ||
user_enemies_of_enemies = FOREACH (GROUP user_enemy_enemy BY user_id) { | ||
name = LIMIT user_enemy_enemy.name 1; | ||
enemies_of_enemies = DISTINCT user_enemy_enemy.enemy_enemy_id; | ||
GENERATE group AS user_id, FLATTEN(name), enemies_of_enemies AS enemies_of_enemies; | ||
} | ||
|
||
rmf $OUTPUT_PATH | ||
STORE friends_users_histogram INTO '$OUTPUT_PATH/friends_users_hist'; | ||
STORE enemies_users_histogram INTO '$OUTPUT_PATH/enemies_users_hist'; | ||
STORE narcissists INTO '$OUTPUT_PATH/narcissists'; | ||
STORE masochists INTO '$OUTPUT_PATH/masochists'; | ||
STORE user_enemies_of_enemies INTO '$OUTPUT_PATH/frenemies'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.