svn commit: r1397921 - in /accumulo/branches/1.4/src/core/src: main/java/org/apache/accumulo/core/client/admin/ main/java/org/apache/accumulo/core/client/mock/ main/java/org/apache/accumulo/core/itera

2012-10-13 Thread kturner
Author: kturner
Date: Sat Oct 13 18:52:18 2012
New Revision: 1397921

URL: http://svn.apache.org/viewvc?rev=1397921view=rev
Log:
ACCUMULO-795 Applied patch from Drew Farris that allows mock to create tables 
w/o versioning

Modified:

accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java

accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java

accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java

accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java

accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java

Modified: 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
URL: 
http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java?rev=1397921r1=1397920r2=1397921view=diff
==
--- 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
 (original)
+++ 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
 Sat Oct 13 18:52:18 2012
@@ -180,11 +180,7 @@ public class TableOperationsImpl extends
 
 ListByteBuffer args = 
Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), 
ByteBuffer.wrap(timeType.name().getBytes()));
 
-MapString,String opts;
-if (limitVersion) {
-  opts = IteratorUtil.generateInitialTableProperties();
-} else
-  opts = Collections.emptyMap();
+MapString,String opts = 
IteratorUtil.generateInitialTableProperties(limitVersion);
 
 try {
   doTableOperation(TableOperation.CREATE, args, opts);

Modified: 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: 
http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1397921r1=1397920r2=1397921view=diff
==
--- 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
 (original)
+++ 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
 Sat Oct 13 18:52:18 2012
@@ -86,9 +86,9 @@ public class MockTable {
   MapString,EnumSetTablePermission userPermissions = new 
HashMapString,EnumSetTablePermission();
   private TimeType timeType;
   
-  MockTable(boolean useVersions, TimeType timeType) {
+  MockTable(boolean limitVersion, TimeType timeType) {
 this.timeType = timeType;
-settings = IteratorUtil.generateInitialTableProperties();
+settings = IteratorUtil.generateInitialTableProperties(limitVersion);
 for (EntryString,String entry : 
AccumuloConfiguration.getDefaultConfiguration()) {
   String key = entry.getKey();
   if (key.startsWith(Property.TABLE_PREFIX.getKey()))

Modified: 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
URL: 
http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java?rev=1397921r1=1397920r2=1397921view=diff
==
--- 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
 (original)
+++ 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
 Sat Oct 13 18:52:18 2012
@@ -87,13 +87,22 @@ public class IteratorUtil {
 return props;
   }
   
-  public static MapString,String generateInitialTableProperties() {
+  /**
+   * Generate the initial (default) properties for a table
+   * @param limitVersion
+   *   include a VersioningIterator at priority 20 that retains a single 
version of a given K/V pair.
+   * @return A map of Table properties
+   */
+  public static MapString,String generateInitialTableProperties(boolean 
limitVersion) {
 TreeMapString,String props = new TreeMapString,String();
 
-for (IteratorScope iterScope : IteratorScope.values()) {
-  props.put(Property.TABLE_ITERATOR_PREFIX + iterScope.name() + .vers, 
20, + VersioningIterator.class.getName());
-  props.put(Property.TABLE_ITERATOR_PREFIX + iterScope.name() + 
.vers.opt.maxVersions, 1);
+if (limitVersion) {
+for (IteratorScope iterScope : IteratorScope.values()) {
+  props.put(Property.TABLE_ITERATOR_PREFIX + iterScope.name() + 
.vers, 20, + VersioningIterator.class.getName());
+  props.put(Property.TABLE_ITERATOR_PREFIX + iterScope.name() + 
.vers.opt.maxVersions, 1);
+}
 }
+
 return 

svn commit: r1397928 - in /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver: SimpleLRUCache.java SimpleLRUCacheTest.java TabletServer.java

2012-10-13 Thread ecn
Author: ecn
Date: Sat Oct 13 19:05:15 2012
New Revision: 1397928

URL: http://svn.apache.org/viewvc?rev=1397928view=rev
Log:
ACCUMULO-774 reduce the chances of warnings due to recently unloaded tablets

Added:

accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCache.java

accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
Modified:

accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java

Added: 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCache.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCache.java?rev=1397928view=auto
==
--- 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCache.java
 (added)
+++ 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCache.java
 Sat Oct 13 19:05:15 2012
@@ -0,0 +1,81 @@
+/*
+ * 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
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.server.tabletserver;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+
+public class SimpleLRUCacheT extends HashSetT {
+  
+  private static final long serialVersionUID = 1L;
+  
+  final int max;
+  ListT recent = new LinkedListT();
+  
+  public SimpleLRUCache(int max) {
+this.max = max;
+  }
+  
+  @Override
+  public boolean add(T e) {
+boolean result = super.add(e);
+if (result) {
+  recent.add(e);
+  if (recent.size()  max) {
+T oldest = recent.remove(0);
+super.remove(oldest);
+  }
+} else {
+  recent.remove(e);
+  recent.add(e);
+}
+return result;
+  }
+  
+  @Override
+  public boolean remove(Object o) {
+if (super.remove(o)) {
+  recent.remove(o);
+  return true;
+}
+return false;
+  }
+  
+  @Override
+  public boolean addAll(Collection? extends T c) {
+throw new UnsupportedOperationException();
+  }
+  
+  @Override
+  public boolean retainAll(Collection? c) {
+throw new UnsupportedOperationException();
+  }
+  
+  @Override
+  public boolean removeAll(Collection? c) {
+throw new UnsupportedOperationException();
+  }
+  
+  @Override
+  public void clear() {
+super.clear();
+recent.clear();
+  }
+  
+}

Added: 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java?rev=1397928view=auto
==
--- 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
 (added)
+++ 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
 Sat Oct 13 19:05:15 2012
@@ -0,0 +1,38 @@
+/*
+ * 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
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.server.tabletserver;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class SimpleLRUCacheTest {
+  
+  @Test
+  public void test() {
+SimpleLRUCacheInteger test = new SimpleLRUCacheInteger(4);
+test.add(0);
+assertTrue(test.contains(0));
+test.add(1);

svn commit: r1397936 - in /accumulo/trunk: ./ core/ core/src/main/java/org/apache/accumulo/core/client/admin/ core/src/main/java/org/apache/accumulo/core/client/mock/ core/src/main/java/org/apache/acc

2012-10-13 Thread kturner
Author: kturner
Date: Sat Oct 13 19:43:30 2012
New Revision: 1397936

URL: http://svn.apache.org/viewvc?rev=1397936view=rev
Log:
ACCUMULO-795 Applied patch from Drew Farris that allows mock to create tables 
w/o versioning (merged from 1.4)

Modified:
accumulo/trunk/   (props changed)
accumulo/trunk/core/   (props changed)

accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java

accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java

accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java

accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java

accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   
(props changed)
accumulo/trunk/server/   (props changed)
accumulo/trunk/src/   (props changed)

Propchange: accumulo/trunk/
--
  Merged /accumulo/branches/1.4/src:r1397921
  Merged /accumulo/branches/1.4:r1397921

Propchange: accumulo/trunk/core/
--
  Merged /accumulo/branches/1.4/core:r1397921
  Merged /accumulo/branches/1.4/src/core:r1397921

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java?rev=1397936r1=1397935r2=1397936view=diff
==
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
 Sat Oct 13 19:43:30 2012
@@ -190,11 +190,7 @@ public class TableOperationsImpl extends
 
 ListByteBuffer args = 
Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), 
ByteBuffer.wrap(timeType.name().getBytes()));
 
-MapString,String opts;
-if (limitVersion) {
-  opts = IteratorUtil.generateInitialTableProperties();
-} else
-  opts = Collections.emptyMap();
+MapString,String opts = 
IteratorUtil.generateInitialTableProperties(limitVersion);
 
 try {
   doTableOperation(TableOperation.CREATE, args, opts);

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1397936r1=1397935r2=1397936view=diff
==
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
 Sat Oct 13 19:43:30 2012
@@ -88,9 +88,9 @@ public class MockTable {
   private TimeType timeType;
   SortedSetText splits = new TreeSetText();
   
-  MockTable(boolean useVersions, TimeType timeType) {
+  MockTable(boolean limitVersion, TimeType timeType) {
 this.timeType = timeType;
-settings = IteratorUtil.generateInitialTableProperties();
+settings = IteratorUtil.generateInitialTableProperties(limitVersion);
 for (EntryString,String entry : 
AccumuloConfiguration.getDefaultConfiguration()) {
   String key = entry.getKey();
   if (key.startsWith(Property.TABLE_PREFIX.getKey()))

Modified: 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java?rev=1397936r1=1397935r2=1397936view=diff
==
--- 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
 (original)
+++ 
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
 Sat Oct 13 19:43:30 2012
@@ -63,13 +63,22 @@ public class IteratorUtil {
 
   }
   
-  public static MapString,String generateInitialTableProperties() {
+  /**
+   * Generate the initial (default) properties for a table
+   * @param limitVersion
+   *   include a VersioningIterator at priority 20 that retains a single 
version of a given K/V pair.
+   * @return A map of Table properties
+   */
+  public static MapString,String generateInitialTableProperties(boolean 
limitVersion) {
 TreeMapString,String props = new TreeMapString,String();
 
-for (IteratorScope iterScope : IteratorScope.values()) {
-  props.put(Property.TABLE_ITERATOR_PREFIX + iterScope.name() + .vers, 
20, + VersioningIterator.class.getName());
-  

svn commit: r1397975 - /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java

2012-10-13 Thread elserj
Author: elserj
Date: Sun Oct 14 00:20:34 2012
New Revision: 1397975

URL: http://svn.apache.org/viewvc?rev=1397975view=rev
Log:
ACCUMULO-774 Fixed Assert import to get trunk test passing again.

Modified:

accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java

Modified: 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java?rev=1397975r1=1397974r2=1397975view=diff
==
--- 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
 (original)
+++ 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
 Sun Oct 14 00:20:34 2012
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.server.tabletserver;
 
-import static org.junit.Assert.*;
+import static junit.framework.Assert.*;
 
 import org.junit.Test;
 




svn commit: r1397987 - /accumulo/trunk/server/src/main/c++/mlock/Makefile

2012-10-13 Thread elserj
Author: elserj
Date: Sun Oct 14 00:59:11 2012
New Revision: 1397987

URL: http://svn.apache.org/viewvc?rev=1397987view=rev
Log:
ACCUMULO-160 Applying changes to the nativeMap's Makefile to the MLock's 
Makefile too

Modified:
accumulo/trunk/server/src/main/c++/mlock/Makefile

Modified: accumulo/trunk/server/src/main/c++/mlock/Makefile
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/c%2B%2B/mlock/Makefile?rev=1397987r1=1397986r2=1397987view=diff
==
--- accumulo/trunk/server/src/main/c++/mlock/Makefile (original)
+++ accumulo/trunk/server/src/main/c++/mlock/Makefile Sun Oct 14 00:59:11 2012
@@ -19,13 +19,33 @@ HDRS=$(wildcard *.h) org_apache_accumulo
 CXX=g++
 
 ifeq ($(shell uname),Linux)
-LIBS:= lib$(LIB)-Linux-amd64-64.so lib$(LIB)-Linux-i386-32.so
-CXXFLAGS=-g -fPIC -shared -O2 -fno-omit-frame-pointer -fno-strict-aliasing 
-Wall  -I$(JAVA_HOME)/include/linux -I$(JAVA_HOME)/include
+  LIBS_32 := lib$(LIB)-Linux-i386-32.so
+  LIBS_64 := lib$(LIB)-Linux-amd64-64.so
+  
+  ifneq ($(DARCH),)
+ifeq ($(DARCH),64)
+  LIBS := $(LIBS_64)
+endif
+ifeq ($(DARCH),32)
+  LIBS := $(LIBS_32)
+endif
+ifeq ($(DARCH),both)
+  LIBS := $(LIBS_64)$(LIBS_32)
+endif
+ifeq ($(LIBS),)
+  LIBS := $(LIBS_64)$(LIBS_32)
+endif
+  else
+DARCH := $(shell getconf LONG_BIT)
+LIBS := $(LIBS_$(DARCH))
+  endif
+
+  CXXFLAGS=-g -fPIC -shared -O2 -fno-omit-frame-pointer -fno-strict-aliasing 
-Wall  -I$(JAVA_HOME)/include/linux -I$(JAVA_HOME)/include
 endif
 
 ifeq ($(shell uname),Darwin)
-LIBS:= lib$(LIB)-Mac_OS_X-x86_64-64.jnilib
-CXXFLAGS=-m64 -dynamiclib -O3 
-I/System/Library/Frameworks/JavaVM.framework/Headers
+  LIBS:= lib$(LIB)-Mac_OS_X-x86_64-64.jnilib
+  CXXFLAGS=-m64 -dynamiclib -O3 
-I/System/Library/Frameworks/JavaVM.framework/Headers
 endif
 
 INSTALL_DIR=../../../../../lib/native/mlock




svn commit: r1397990 - in /accumulo/trunk/server/src: main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java test/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.jav

2012-10-13 Thread elserj
Author: elserj
Date: Sun Oct 14 01:33:42 2012
New Revision: 1397990

URL: http://svn.apache.org/viewvc?rev=1397990view=rev
Log:
ACCUMULO-774 I apparently spaced out. It was broken because of a bad import, 
the test was in src/main not src/test.

Added:

accumulo/trunk/server/src/test/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
  - copied, changed from r1397988, 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
Removed:

accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java

Copied: 
accumulo/trunk/server/src/test/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
 (from r1397988, 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java)
URL: 
http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java?p2=accumulo/trunk/server/src/test/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.javap1=accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.javar1=1397988r2=1397990rev=1397990view=diff
==
--- 
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
 (original)
+++ 
accumulo/trunk/server/src/test/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
 Sun Oct 14 01:33:42 2012
@@ -16,7 +16,7 @@
  */
 package org.apache.accumulo.server.tabletserver;
 
-import static junit.framework.Assert.*;
+import static org.junit.Assert.*;
 
 import org.junit.Test;