Skip to content

Commit 3827a91

Browse files
committed
add support for NIO getMulti, reduce lock contention, clean up native handler code
1 parent 3b6b41a commit 3827a91

File tree

9 files changed

+864
-675
lines changed

9 files changed

+864
-675
lines changed

build.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@
110110
<jar compress="yes" jarfile="java_memcached-${ver}/java_memcached-${ver}.jar" basedir="java_memcached-${ver}/classes"/>
111111
</target>
112112

113-
<!-- compilation target for dev work -->
113+
<!-- compilation target -->
114114
<target name="compile">
115115
<mkdir dir="${build.dir}"/>
116-
<javac debug="yes" srcdir="${src.dir}" destdir="${build.dir}" deprecation="true">
116+
<javac debug="yes" srcdir="${src.dir}" destdir="${build.dir}" deprecation="true" compiler="modern">
117+
<compilerarg value="-Xlint:unchecked"/>
117118
<classpath refid="project.class.path"/>
118119
</javac>
119120
</target>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* src/com/danga/MemCached/LineInputStream.java
3+
*
4+
* @author $Author: $
5+
* @version $Revision: $ $Date: $
6+
* copyright (c) 2006 meetup, inc
7+
*
8+
* $Id: $
9+
*/
10+
package com.danga.MemCached;
11+
12+
import java.io.IOException;
13+
14+
public interface LineInputStream {
15+
16+
/**
17+
* Read everything up to the next end-of-line. Does
18+
* not include the end of line, though it is consumed
19+
* from the input.
20+
* @return All next up to the next end of line.
21+
*/
22+
public String readLine() throws IOException;
23+
24+
/**
25+
* Read everything up to and including the end of line.
26+
*/
27+
public void clearEOL() throws IOException;
28+
29+
/**
30+
* Read some bytes.
31+
* @param buf The buffer into which read.
32+
* @return The number of bytes actually read, or -1 if none could be read.
33+
*/
34+
public int read( byte[] buf ) throws IOException;
35+
}

src/com/danga/MemCached/Logger.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ public void debug( String mesg ) {
126126
debug( mesg, null );
127127
}
128128

129+
public boolean isDebugEnabled() {
130+
return this.level <= LEVEL_DEBUG;
131+
}
132+
129133
/**
130134
* logs info mesg
131135
*
@@ -143,6 +147,10 @@ public void info( String mesg ) {
143147
info( mesg, null );
144148
}
145149

150+
public boolean isInfoEnabled() {
151+
return this.level <= LEVEL_INFO;
152+
}
153+
146154
/**
147155
* logs warn mesg
148156
*

0 commit comments

Comments
 (0)