Skip to content

Instantly share code, notes, and snippets.

0% done. Using: 0.000000 MB
Deletes starting. 2% done. Using: 35.179070 MB
10% done. Using: 143.416156 MB
20% done. Using: 343.661770 MB
30% done. Using: 547.685583 MB
40% done. Using: 747.931368 MB
50% done. Using: 948.176880 MB
60% done. Using: 1,152.201424 MB
70% done. Using: 1,352.446961 MB
80% done. Using: 1,552.693105 MB
@chirino
chirino / DBCompactionTest.java
Created April 16, 2013 22:50
A test case showing that leveldb compaction don't work so good /w sequencial insert and delete. Related to a mailing list post[1] and a reported bug [2]. [1]: https://groups.google.com/d/msg/leveldb/yL6h1mAOc20/vLU64RylIdMJ [2]: https://code.google.com/p/leveldb/issues/detail?id=77
import org.fusesource.leveldbjni.JniDBFactory;
import org.iq80.leveldb.*;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Random;
public class DBCompactionTest {
$ svn diff
Index: src/main/java/org/apache/cxf/cwiki/SiteExporter.java
===================================================================
--- src/main/java/org/apache/cxf/cwiki/SiteExporter.java (revision 1397571)
+++ src/main/java/org/apache/cxf/cwiki/SiteExporter.java (working copy)
@@ -365,33 +365,37 @@
doc = getDispatch().invoke(doc);
el = DOMUtils.getFirstElement(DOMUtils.getFirstElement(doc.getDocumentElement()));
while (el != null) {
- String filename = DOMUtils.getChildContent(el, "fileName");
/*
*
* 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
*
<connector ...>
<detect protocols="stomp openwire"/>
</connector>
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
#!/bin/sh
# ------------------------------------------------------------------------
# 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
@chirino
chirino / gist:2967478
Created June 21, 2012 18:09
A simple example of how to use SSL with HawtDispatch (and logs into to a STOMP server).
import org.fusesource.hawtbuf.AsciiBuffer;
import org.fusesource.hawtbuf.Buffer;
import org.fusesource.hawtdispatch.Dispatch;
import org.fusesource.hawtdispatch.Task;
import org.fusesource.hawtdispatch.transport.AbstractProtocolCodec;
import org.fusesource.hawtdispatch.transport.DefaultTransportListener;
import org.fusesource.hawtdispatch.transport.SslTransport;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
@chirino
chirino / minscalaactors.scala
Created May 24, 2012 16:51 — forked from viktorklang/minscalaactors.scala
Minimalist Scala Actors using HawtDispatch
// ©2012 Viktor Klang
// ©2012 Hiram Chirino
object Actor {
import org.fusesource.hawtdispatch._
type Behavior = Any => Effect
sealed trait Effect extends (Behavior => Behavior)
case object Stay extends Effect { def apply(old: Behavior): Behavior = old }
case class Become(like: Behavior) extends Effect { def apply(old: Behavior): Behavior = like }
final val Die = Become(msg => { println("Dropping msg [" + msg + "] due to severe case of death."); Stay }) // Stay Dead plz
Tuple3 {
inline def forEach(fn: Function<Any?,Unit>):Unit = {
fn.invoke(this._1)
fn.invoke(this._2)
fn.invoke(this._3)
}
}