This file contains hidden or 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
@GET | |
@Produces(MediaType.APPLICATION_JSON) | |
@Path("/json") | |
@Timed | |
public StreamingOutput listingToJson( | |
@QueryParam("path") final String path, | |
@QueryParam("recursive") final boolean recursive, | |
@QueryParam("pretty") final boolean pretty, | |
@QueryParam("raw") final boolean raw | |
) throws IOException |
This file contains hidden or 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
Simple: | |
digraph G { | |
rankdir = BT | |
node [shape = "box"] | |
HDFS -> Event -> Schema | |
} | |
More complex: |
This file contains hidden or 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
// Look for JVM bug | |
if (selected==0 && wait>0 && (now-before)<wait/2 && _selector.selectedKeys().size()==0) | |
{ | |
if (_jvmBug++>5) // TODO tune or configure this | |
{ | |
// Probably JVM BUG! | |
Iterator iter = _selector.keys().iterator(); | |
while(iter.hasNext()) | |
{ |
This file contains hidden or 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
ruby-1.8.7-p334 :001 > require 'smile' | |
=> true | |
ruby-1.8.7-p334 :002 > p = Smile::Parser.new("data.smile") | |
=> #<Smile::Parser:0x100362210> | |
ruby-1.8.7-p334 :003 > puts p.check_header | |
true | |
=> nil | |
ruby-1.8.7-p334 :008 > p = Smile::Parser.new("dummy.txt") | |
=> #<Smile::Parser:0x1003324e8> | |
ruby-1.8.7-p334 :009 > puts p.check_header |
This file contains hidden or 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
package com.ning.metrics.eventtracker; | |
import org.eclipse.jetty.server.Connector; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.server.nio.SelectChannelConnector; | |
import org.testng.annotations.AfterClass; | |
import org.testng.annotations.BeforeClass; | |
import org.testng.annotations.Test; | |
import java.io.IOException; |
This file contains hidden or 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
#!/usr/bin/env ruby | |
if ARGV[0] == "-k" | |
orig_lines=`/bin/df #{ARGV.join(" ")}`.split("\n") | |
puts orig_lines[0] | |
orig_lines[1..-1].each do |line| | |
numbers_line = line.split() | |
numbers_line[1] = numbers_line[2].to_i + numbers_line[3].to_i | |
puts numbers_line.join(" ") | |
end | |
else |
This file contains hidden or 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 class SubscriberConfig { | |
@JsonValue | |
public String name; | |
@JsonValue | |
public String type; | |
@JsonMagicThisIsHowYouShouldResolveMyType | |
public Class getClassForJsonNode(HashMap<Object, Object> rawJson) { | |
return Class.forName(((String) rawJson).get("type") + "Config"); |
This file contains hidden or 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
/* | |
* Copyright 2011 Ning, Inc. | |
* | |
* Ning licenses this file to you under the Apache License, version 2.0 | |
* (the "License"); you may not use this file except in compliance with the | |
* License. You may obtain a copy of the License at: | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
/* | |
* Copyright 2010 Ning, Inc. | |
* | |
* Ning licenses this file to you under the Apache License, version 2.0 | |
* (the "License"); you may not use this file except in compliance with the | |
* License. You may obtain a copy of the License at: | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
diff --git a/src/main/java/com/ning/metrics/eventtracker/ScribeSender.java b/src/main/java/com/ning/metrics/eventtracker/ScribeSender.java | |
index e8ffdda..f9b707b 100644 | |
--- a/src/main/java/com/ning/metrics/eventtracker/ScribeSender.java | |
+++ b/src/main/java/com/ning/metrics/eventtracker/ScribeSender.java | |
@@ -24,42 +24,65 @@ import org.apache.commons.logging.LogFactory; | |
import org.apache.thrift.transport.TTransportException; | |
import scribe.thrift.LogEntry; | |
import scribe.thrift.ResultCode; | |
import java.io.ByteArrayOutputStream; |
NewerOlder