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
override def next : Option[Job] = { | |
println("I FINISHED PROCESSING!") | |
None | |
} |
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
override def next : Option[Job] = { | |
log.info("I FINISHED PROCESSING!") | |
val results = Tsv(outputdir).readAtSubmitter[String].foreach(line => { | |
log.info("LINE: " + line) | |
}) | |
None | |
} |
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
jim@localhost: ~/temp | |
➺ fab stats -H 100.100.1.113,100.100.2.220 -P -f fab-count.py | |
[100.100.1.113] Executing task 'stats' | |
[100.100.1.113] Executing task 'get_stats' | |
[100.100.2.220] Executing task 'get_stats' | |
[100.100.2.220] sudo: lsof -i -sTCP:ESTABLISHED | wc -l | |
[100.100.1.113] sudo: lsof -i -sTCP:ESTABLISHED | wc -l | |
[100.100.2.220] out: 36 | |
[100.100.2.220] out: |
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
jim@ubuntu:~/Code/projects/go-lang-idea-plugin$ ant -f build-package.xml | |
Buildfile: /home/jim/Code/projects/go-lang-idea-plugin/build-package.xml | |
clean: | |
[delete] Deleting directory /home/jim/Code/projects/go-lang-idea-plugin/build | |
init: | |
[mkdir] Created dir: /home/jim/Code/projects/go-lang-idea-plugin/build | |
[mkdir] Created dir: /home/jim/Code/projects/go-lang-idea-plugin/dist | |
[echo] Using IDEA build from: /home/jim/Downloads/idea-IC-135.1289 |
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
jim@ubuntu:~/Code/projects/go-lang-idea-plugin$ ant -f build-package.xml | |
Buildfile: /home/jim/Code/projects/go-lang-idea-plugin/build-package.xml | |
clean: | |
[delete] Deleting directory /home/jim/Code/projects/go-lang-idea-plugin/build | |
init: | |
[mkdir] Created dir: /home/jim/Code/projects/go-lang-idea-plugin/build | |
[echo] Using IDEA build from: /home/jim/Downloads/idea-IC-138.2458.8 |
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
// check to see if we've already sent this alert recently | |
func alreadySentRecently(res reservation) bool { | |
timeNow := time.Now().UTC() | |
mapKey := res.App + res.Component | |
waitForNotifyTime := time.Duration(cfg.Main.HoursBetweenAlerts) * time.Hour | |
_, ok := sentAlerts[mapKey] | |
if !ok { | |
sentAlerts[mapKey] = timeNow | |
l.info("Sending new alert for [%s/%s]", res.App, res.Component) |
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
public void testThatDifferentRPCandHttpPortsAreOK() | |
throws IOException { | |
Configuration conf = new HdfsConfiguration(); | |
FileSystem.setDefaultUri(conf, "hdfs://localhost:8000"); | |
conf.set(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY, "127.0.0.1:9000"); | |
try { | |
NameNode nameNode = new NameNode(conf); // should be OK! | |
} catch (Exception e) { |
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
-- Data would be in the following format | |
-- 2011-01-01^pageview^http://somesite.com/url1^randomuserid123 | |
DEFINE grvschema(inputdata) | |
returns BEACONS { | |
$BEACONS = LOAD '$inputdata' USING PigStorage('^') as (date:chararray, action:chararray, url:chararray, userId:chararray); | |
}; |
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
-- Set the default number of reducers for this script | |
set default_parallel 15; | |
set job.name unique_users | |
-- INCLUDE THE OFFICIAL SCHEMA, beacons will be a relation returned | |
IMPORT 'schema.pig'; | |
beacons = grvschema('$input'); | |
fb = FOREACH beacons GENERATE userGuid; |
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
/** | |
* here we're going to test the loan pattern using something we do all the time, iterate over files and work with | |
* the lines in those files. Java makes it a pain the arse to just read simple lines in a file, lots of set up | |
* code and resource management. The nice part of this pattern is once you create that set up code once you can | |
* use a nice clean API like the one seen below. | |
* You can see here we're passing in a function to "withFileIterator that accepts a "line" string, we then can | |
* work on that line string freely and the resource will be closed in a finally block behind the scenes. | |
*/ | |
@Test | |
def loanPatternWithFileIterator() { |
OlderNewer