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
| def createColumn(name: String, columnFamily : ColumnDefinition) = columnFamily.setName(name).setValidationClass("UTF8Type").setKeysIndex(name) | |
| def createKeySpace(name : String) { | |
| val ks = context.getEntity.makeKeyspaceDefinition().setName(name).setStrategyClass("SimpleStrategy").setStrategyOptions(Map("replication_factor"->"1") ) | |
| context.getEntity.addKeyspace(ks) | |
| } | |
| def createNewColumnFamily() = { |
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
| import sbt._ | |
| import Keys._ | |
| import sbt.Package._ | |
| import java.util.jar.Attributes.Name._ | |
| import com.typesafe.sbtscalariform.ScalariformPlugin._ | |
| import scalariform.formatter.preferences._ | |
| object CMSBuild extends Build { | |
| override lazy val settings = super.settings :+ |
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
| import sbt._ | |
| import Keys._ | |
| import sbt.Package._ | |
| import java.util.jar.Attributes.Name._ | |
| import com.typesafe.sbtscalariform.ScalariformPlugin._ | |
| import scalariform.formatter.preferences._ | |
| object CMSBuild extends Build { | |
| override lazy val settings = super.settings :+ |
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
| import com.twitter.finagle.http.service.RoutingService | |
| import com.twitter.finagle.http.{Request, Response, RichHttp, Http} | |
| import com.twitter.finagle.{Service, SimpleFilter} | |
| import org.jboss.netty.handler.codec.http._ | |
| import org.jboss.netty.handler.codec.http.HttpResponseStatus._ | |
| import org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1 | |
| import org.jboss.netty.buffer.ChannelBuffers.copiedBuffer | |
| import org.jboss.netty.util.CharsetUtil.UTF_8 | |
| import com.twitter.util.Future | |
| import java.net.InetSocketAddress |
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
| class ShowService extends Service[Request, Response] { | |
| def apply(request: Request) = { | |
| val response = new DefaultHttpResponse(HTTP_1_1, OK) | |
| response.setContent(copiedBuffer("show service world", UTF_8)) | |
| Future.value(Response(response)) | |
| } | |
| } | |
| class SearchService(val i : Int) extends Service[Request, Response] { | |
| def apply(request: Request) = { |
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 Netflix | |
| * | |
| * Licensed 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
| import com.twitter.finagle.http.path._ | |
| import com.twitter.finagle.http.service.RoutingService | |
| import com.twitter.finagle.http.{Request, Response, RichHttp, Http} | |
| import com.twitter.finagle.{Service, SimpleFilter} | |
| import org.jboss.netty.handler.codec.http._ | |
| import org.jboss.netty.handler.codec.http.HttpResponseStatus._ | |
| import org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1 | |
| import org.jboss.netty.buffer.ChannelBuffers.copiedBuffer | |
| import org.jboss.netty.util.CharsetUtil.UTF_8 | |
| import com.twitter.util.Future |
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
| @JniMethod(cast="Cache *", accessor="NewLRUCache") | |
| public static final native long NewLRUCache(@JniArg(cast="size_t") long capacity); | |
| // Now the method returns std::shared_ptr<Cache> instead of Cache* | |
| @JniMethod(cast="std::shared_ptr<Cache>", accessor="NewLRUCache") | |
| public static final native long NewLRUCache(@JniArg(cast="size_t") long capacity); |
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
| function million { | |
| m="$1" | |
| if [ -z "$m" ] ; then | |
| $m=1 | |
| fi | |
| echo $((m * 1000000)) | |
| } | |
| function billion { | |
| inMillions=$(million "$1") |
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
| 1 d-link (192.168.1.1) 2.439 ms 0.876 ms 0.876 ms | |
| 2 192.168.1.224 (192.168.1.224) 40.698 ms 41.331 ms 41.444 ms | |
| 3 static-10.242.93.111.tataidc.co.in (111.93.242.10) 41.529 ms 40.502 ms 40.775 ms | |
| 4 115.113.207.153.static-hyderabad.vsnl.net.in (115.113.207.153) 58.894 ms 40.005 ms 43.457 ms | |
| 5 172.29.253.33 (172.29.253.33) 40.823 ms 92.178 ms 60.774 ms | |
| 6 172.25.81.134 (172.25.81.134) 67.568 ms 76.179 ms 74.707 ms | |
| 7 * * * | |
| 8 115.114.85.233 (115.114.85.233) 103.889 ms 204.188 ms 53.523 ms | |
| 9 * if-9-5.tcore1.wyn-marseille.as6453.net (80.231.217.17) 232.438 ms * | |
| 10 if-2-2.tcore2.wyn-marseille.as6453.net (80.231.217.2) 183.717 ms 176.575 ms * |