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
ibalashov@ibalashov-wire:~/tmp/xx/kafkacat$ ./bootstrap.sh | |
Downloading librdkafka-master | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 127 0 127 0 0 166 0 --:--:-- --:--:-- --:--:-- 166 | |
0 0 0 188k 0 0 59144 0 --:--:-- 0:00:03 --:--:-- 83502 | |
Building librdkafka-master | |
checking for OS or distribution... ok (osx) | |
checking for C compiler from CC env... failed | |
checking for gcc (by command)... ok |
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
package akkatest | |
import akka.actor._ | |
import akka.routing.RoundRobinPool | |
import com.typesafe.config.{Config, ConfigFactory} | |
import com.typesafe.scalalogging.slf4j.LazyLogging | |
object TestSystem extends LazyLogging { | |
case object PingObj |
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
package akkatest | |
import akka.actor._ | |
import akka.routing.RoundRobinPool | |
import com.typesafe.config.{Config, ConfigFactory} | |
import com.typesafe.scalalogging.slf4j.LazyLogging | |
import iow.common.util.NetUtil | |
import net.iponweb.kafka.util.MiscUtil | |
import scala.util.Try |
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
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF 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 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 StorageObject uploadFile(String bucketName, File file, String remoteDirectory) throws Exception { | |
InputStream stream = new BufferedInputStream(new FileInputStream(file)); | |
try { | |
InputStreamContent mediaContent = new InputStreamContent("application/octet-stream", stream); | |
mediaContent.setLength(file.length()); | |
Storage.Objects.Insert insert = storage.objects().insert(bucketName, null, mediaContent); | |
insert.getMediaHttpUploader().setDisableGZipContent(true); | |
if (mediaContent.getLength() > 0 && mediaContent.getLength() <= 2 * 1000 * 1000 /* 2MB */) { | |
insert.getMediaHttpUploader().setDirectUploadEnabled(true); |
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
Reverse Call Tree | Time (ms) | Level | |
---|---|---|---|
com.sun.crypto.provider.GHASH.update(byte[], int, int) GHASH.java | 438036 | 1 | |
com.sun.crypto.provider.GaloisCounterMode.doLastBlock(byte[], int, int, byte[], int, boolean) GaloisCounterMode.java:362 | 435964 | 2 | |
com.sun.crypto.provider.GaloisCounterMode.encryptFinal(byte[], int, int, byte[], int) GaloisCounterMode.java:419 | 3 | ||
com.sun.crypto.provider.CipherCore.finalNoPadding(byte[], int, byte[], int, int) CipherCore.java:1025 | 4 | ||
com.sun.crypto.provider.CipherCore.doFinal(byte[], int, int, byte[], int) CipherCore.java:984 | 5 | ||
com.sun.crypto.provider.AESCipher.engineDoFinal(byte[], int, int, byte[], int) AESCipher.java:479 | 6 | ||
javax.crypto.Cipher.doFinal(byte[], int, int, byte[], int) Cipher.java:2377 | 7 | ||
sun.security.ssl.CipherBox.encrypt(byte[], int, int) CipherBox.java:315 | 8 | ||
sun.security.ssl.OutputRecord.encrypt(Authenticator, CipherBox) OutputRecord.java:264 | 9 |
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
#!/usr/bin/env bash | |
# Boot script for Spark master | |
### BEGIN INIT INFO | |
# Provides: spark-master | |
# Required-Start: $all $network | |
# Required-Stop: $all $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Spark-master | |
# Description: Spark-master (http://hadoop.apache.org/) |
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
% cat twitter.snappy.incomplete.avro | |
Objavro.codec | |
snappyavro.schema�{"type":"record","name":"twitter_schema","namespace":"com.miguno.avro","fields":[{"name":"username","type":"string","doc":"Name of the user account on Twitter.com"},{"name":"tweet","type":"string","doc":"The content of the user's Twitter message"},{"name":"timestamp","type":"long","doc":"Unix epoch time in milliseconds"}],"doc:":"A basic schema for storing Twitter messages"}5\�1��~����H����d�c | |
migunoFRock: Nerf paper, scissors is fine.��� | |
BlizzardCSFWor% | |
% fastavro twitter.snappy.incomplete.avro | |
Traceback (most recent call last): | |
File "/usr/local/bin/fastavro", line 9, in <module> |
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 static List<Integer> generate(int series) { | |
return Stream.iterate(new int[]{0, 1}, s -> new int[]{s[1], s[0] + s[1]}) | |
.limit(series) | |
.map(n -> n[0]) | |
.collect(Collectors.toList()); | |
} | |
public static void main(String[] args) { | |
generate(30).forEach(n -> { | |
List<String> collected = Stream.generate(() -> UUID.randomUUID().toString()).limit(n).collect(Collectors.toList()); |
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
package com.outbrain.utils; | |
import java.util.Iterator; | |
public class InterleavedIterator<T> implements Iterator<T> { | |
private Iterator<T> it1; | |
private Iterator<T> it2; | |
private boolean takeFirst; |
OlderNewer