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
/* | |
* Description | |
Using Groonga as Inverted-Index library. | |
* TODO | |
- Not to store document contents (possible?). | |
- Store documents with scores, and order with scores in the index. | |
- Store documents with sections | |
- Store documents with positions | |
- Separate writer/reader function |
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 MyWritableComparable implements WritableComparable<MyWritableComparable> { | |
// Some data | |
private int counter; | |
private long timestamp; | |
public void write(DataOutput out) throws IOException { | |
out.writeInt(counter); | |
out.writeLong(timestamp); | |
} | |
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 MyWritable implements Writable { | |
// Some data | |
private int counter; | |
private long timestamp; | |
public void write(DataOutput out) throws IOException { | |
out.writeInt(counter); | |
out.writeLong(timestamp); | |
} | |
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 net.kzk9; | |
import java.io.IOException; | |
import java.util.StringTokenizer; | |
import org.apache.hadoop.util.GenericOptionsParser; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.LongWritable; |
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 ExistingClass implements MessagePackTemplateProvider { | |
// no serialization is needed; | |
Logger LOG; | |
string internal_data; | |
// data | |
int a; | |
int b; | |
string c; | |
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 java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
public class Main { | |
public static class MyClass { | |
public String s; | |
public int v; |
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 java.io.DataInput; | |
import java.io.DataOutput; | |
import java.io.IOException; | |
import org.apache.hadoop.io.BytesWritable; | |
import org.apache.hadoop.io.WritableComparable; | |
import org.msgpack.MessagePack; | |
public class MessagePackWritable<C> implements WritableComparable<MessagePackWritable<C>> { |
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 org.msgpack.MessagePack; | |
import org.msgpack.annotation.MessagePackMessage; | |
public class Main { | |
@MessagePackMessage | |
public static class MyClass { | |
public String str; | |
} | |
public static void main(String[] args) { |
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
#include <event.h> | |
#include <evhttp.h> | |
#include <pthread.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/in.h> | |
#include <iostream> |
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
// | |
// 2010/11/06 Kazuki Ohta <[email protected]> | |
// Single-Threaded HTTPServer using evhttp | |
// | |
#include <event.h> | |
#include <evhttp.h> | |
#include <unistd.h> | |
namespace servers { |