Skip to content

Commit

Permalink
ACCUMULO-970 - TODO tagging/busting/ticketing/etc.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/accumulo/branches/1.5@1469104 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
John Vines committed Apr 17, 2013
1 parent 811b594 commit ca10f6d
Show file tree
Hide file tree
Showing 29 changed files with 100 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private Pair<KeyExtent,String> getTabletFiles(Range nextRange, List<String> relF
private SortedKeyValueIterator<Key,Value> createIterator(KeyExtent extent, List<String> absFiles) throws TableNotFoundException, AccumuloException,
IOException {

// TODO share code w/ tablet
// TODO share code w/ tablet - ACCUMULO-1303
AccumuloConfiguration acuTableConf = AccumuloConfiguration.getTableConfiguration(conn, tableId);

Configuration conf = CachedConfiguration.getInstance();
Expand All @@ -300,7 +300,7 @@ private SortedKeyValueIterator<Key,Value> createIterator(KeyExtent extent, List<

readers.clear();

// TODO need to close files
// TODO need to close files - ACCUMULO-1303
for (String file : absFiles) {
FileSKVIterator reader = FileOperations.getInstance().openReader(file, false, fs, conf, acuTableConf, null, null);
readers.add(reader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,6 @@ Map<String,Map<KeyExtent,List<Range>>> binOfflineTable(JobConf job, String table

RowIterator rowIter = new RowIterator(scanner);

// TODO check that extents match prev extent

KeyExtent lastExtent = null;

while (rowIter.hasNext()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,6 @@ Map<String,Map<KeyExtent,List<Range>>> binOfflineTable(JobContext context, Strin

RowIterator rowIter = new RowIterator(scanner);

// TODO check that extents match prev extent

KeyExtent lastExtent = null;

while (rowIter.hasNext()) {
Expand Down
22 changes: 21 additions & 1 deletion core/src/main/java/org/apache/accumulo/core/conf/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.log4j.Logger;

public enum Property {

// Crypto-related properties
CRYPTO_PREFIX("crypto.", null, PropertyType.PREFIX, "Properties in this category related to the configuration of both default and custom crypto modules.",
true),
Expand Down Expand Up @@ -358,7 +357,9 @@ public enum Property {
private String key, defaultValue, description;
private PropertyType type;
private boolean experimental;
static Logger log = Logger.getLogger(Property.class);


private Property(String name, String defaultValue, PropertyType type, String description, boolean experimental) {
this.key = name;
this.defaultValue = defaultValue;
Expand Down Expand Up @@ -490,4 +491,23 @@ public boolean isDeprecated() {
}
return false;
}

public static <T> T createInstanceFromPropertyName(AccumuloConfiguration conf, Property property, Class<T> base, T defaultInstance) {
String clazzName = conf.get(property);
T instance = null;

try {
Class<? extends T> clazz = AccumuloVFSClassLoader.loadClass(clazzName, base);
instance = clazz.newInstance();
log.info("Loaded class : " + clazzName);
} catch (Exception e) {
log.warn("Failed to load class ", e);
}

if (instance == null) {
log.info("Using " + defaultInstance.getClass().getName());
instance = defaultInstance;
}
return instance;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.accumulo.core.file.blockfile.cache;

/**
* Block cache interface. TODO: Add filename or hash of filename to block cache key.
* Block cache interface.
*/
public interface BlockCache {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,11 @@ public void addSource(SortedKeyValueIterator<Key,Value> source, IteratorEnvironm
sources = new TermSource[1];
} else {
// allocate space for node, and copy current tree.
// TODO: Should we change this to an ArrayList so that we can just add() ?
// TODO: Should we change this to an ArrayList so that we can just add() ? - ACCUMULO-1309
TermSource[] localSources = new TermSource[sources.length + 1];
int currSource = 0;
for (TermSource myTerm : sources) {
// TODO: Do I need to call new here? or can I just re-use the term?
// TODO: Do I need to call new here? or can I just re-use the term? - ACCUMULO-1309
localSources[currSource] = new TermSource(myTerm);
currSource++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ public void testDeletewithBatchDeleter() throws Exception {
* @param c
* connector to the {@link MockInstance}
* @param tableName
* TODO
* Table to check
* @param count
* number of entries to expect in the table
* @param count
* TODO
* number of rows the table should contain
*/
private void checkRemaining(Connector c, String tableName, int count) throws Exception {
Scanner scanner = c.createScanner(tableName, Constants.NO_AUTHS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ public void treeExpanded(TreeExpansionEvent event) {
try {
populateChildren((DefaultMutableTreeNode) event.getPath().getLastPathComponent());
} catch (TableNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Expand Down
2 changes: 1 addition & 1 deletion fate/src/main/java/org/apache/accumulo/fate/Fate.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public Fate(T environment, TStore<T> store, int numTreads) {
this.environment = environment;

for (int i = 0; i < numTreads; i++) {
// TODO: use a ExecutorService, maybe a utility to do these steps throughout the server packages
// TODO: use an ExecutorService, maybe a utility to do these steps throughout the server packages - ACCUMULO-1311
Thread thread = new Daemon(new LoggingRunnable(log, new TransactionRunner()), "Repo runner " + i);
thread.start();
}
Expand Down
7 changes: 3 additions & 4 deletions fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
import org.apache.zookeeper.KeeperException.NoNodeException;
import org.apache.zookeeper.KeeperException.NodeExistsException;

//TODO use zoocache?
//TODO handle zookeeper being down gracefully
//TODO document zookeeper layout
//TODO use zoocache? - ACCUMULO-1297
//TODO handle zookeeper being down gracefully - ACCUMULO-1297
//TODO document zookeeper layout - ACCUMULO-1298

public class ZooStore<T> implements TStore<T> {

Expand All @@ -66,7 +66,6 @@ private byte[] serialize(Object o) {
} catch (IOException e) {
throw new RuntimeException(e);
}

}

private Object deserialize(byte ser[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
while (returnTime > now) {
if (tryLock())
return true;
// TODO: do something better than poll
// TODO: do something better than poll - ACCUMULO-1310
UtilWaitThread.sleep(100);
now = System.currentTimeMillis();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void release(IZooReaderWriter zk, String path, String reservationI
try {
zooData = zk.getData(path, stat);
} catch (NoNodeException e) {
// TODO log warning? this may happen as a normal course of business.... could return a boolean...
// Just logging a warning, if data is gone then our work here is done.
Logger.getLogger(ZooReservation.class).debug("Node does not exist " + path);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ public void run() {
};
thread.start();
tpc = new TestProxyClient("localhost", port);
userpass = tpc.proxy().login("root", new TreeMap<String, String>() {{put("password",""); }});
userpass = tpc.proxy().login("root", new TreeMap<String,String>() {
{
put("password", "");
}
});
}

@AfterClass
Expand Down Expand Up @@ -106,7 +110,7 @@ public void listRename() throws TException {
}

// This test does not yet function because the backing Mock instance does not yet support merging
// TODO: add back in as a test when Mock is improved
// TODO: add back in as a test when Mock is improved - ACCUMULO-1306
// @Test
public void merge() throws TException {
Set<ByteBuffer> splits = new HashSet<ByteBuffer>();
Expand Down Expand Up @@ -152,9 +156,7 @@ public void constraints() throws TException {
assertNull(constraints.get("org.apache.accumulo.TestConstraint"));
}

// This test does not yet function because the backing Mock instance does not yet support locality groups
// TODO: add back in as a test when Mock is improved
// @Test
@Test
public void localityGroups() throws TException {
Map<String,Set<String>> groups = new HashMap<String,Set<String>>();
Set<String> group1 = new HashSet<String>();
Expand Down Expand Up @@ -202,7 +204,7 @@ public void tableOperationsRowMethods() throws TException {

assertEquals(tpc.proxy().getMaxRow(userpass, testtable, null, null, true, null, true), ByteBuffer.wrap("9".getBytes()));

tpc.proxy().deleteRows(userpass,testtable,ByteBuffer.wrap("51".getBytes()), ByteBuffer.wrap("99".getBytes()));
tpc.proxy().deleteRows(userpass, testtable, ByteBuffer.wrap("51".getBytes()), ByteBuffer.wrap("99".getBytes()));
assertEquals(tpc.proxy().getMaxRow(userpass, testtable, null, null, true, null, true), ByteBuffer.wrap("5".getBytes()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ static private Map<String,String> conf(TCredentials credentials, AccumuloConfigu

Map<String,String> result = new HashMap<String,String>();
for (Entry<String,String> entry : conf) {
// TODO: do we need to send any instance information?
if (entry.getKey().equals(Property.INSTANCE_SECRET.getKey()))
continue;
if (entry.getKey().toLowerCase().contains("password"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.fate.zookeeper.TransactionWatcher.Arbitrator;
import org.apache.accumulo.server.zookeeper.TransactionWatcher.ZooArbitrator;
import org.apache.log4j.Logger;

/**
* A special iterator for the metadata table that removes inactive bulk load flags
*
*/
public class MetadataBulkLoadFilter extends Filter {
private static Logger log = Logger.getLogger(MetadataBulkLoadFilter.class);

enum Status {
ACTIVE, INACTIVE
Expand All @@ -57,8 +59,8 @@ public boolean accept(Key k, Value v) {
status = Status.ACTIVE;
}
} catch (Exception e) {
// TODO log
status = Status.ACTIVE;
log.error(e, e);
}

bulkTxStatusCache.put(txid, status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ private void waitAround(EventCoordinator.Listener listener) {
listener.waitForEvents(ONE_SECOND);
}

// @TODO: maybe move this to Property? We do this in TabletServer, Master, TableLoadBalancer, etc.
// TODO: maybe move this to Property? We do this in TabletServer, Master, TableLoadBalancer, etc. - ACCUMULO-1295
public static <T> T createInstanceFromPropertyName(AccumuloConfiguration conf, Property property, Class<T> base, T defaultInstance) {
String clazzName = conf.get(property);
T instance = null;
Expand Down Expand Up @@ -549,7 +549,6 @@ public void waitForFlush(TInfo tinfo, TCredentials c, String tableId, ByteBuffer
scanner.fetchColumnFamily(Constants.METADATA_LOG_COLUMN_FAMILY);
scanner.setRange(new KeyExtent(new Text(tableId), null, ByteBufferUtil.toText(startRow)).toMetadataRange());

// TODO this used to be TabletIterator... any problems with splits/merges?
RowIterator ri = new RowIterator(scanner);

int tabletsToWaitFor = 0;
Expand Down Expand Up @@ -601,7 +600,7 @@ public void waitForFlush(TInfo tinfo, TCredentials c, String tableId, ByteBuffer
if (tabletsToWaitFor == 0)
break;

// TODO detect case of table offline AND tablets w/ logs?
// TODO detect case of table offline AND tablets w/ logs? - ACCUMULO-1296

if (tabletCount == 0 && !Tables.exists(instance, tableId))
throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.NOTFOUND, null);
Expand Down Expand Up @@ -2060,7 +2059,7 @@ public void run() throws IOException, InterruptedException, KeeperException {

tserverSet.startListeningForTabletServerChanges();

// TODO: add shutdown for fate object
// TODO: add shutdown for fate object - ACCUMULO-1307
try {
final AgeOffStore<Master> store = new AgeOffStore<Master>(new org.apache.accumulo.fate.ZooStore<Master>(ZooUtil.getRoot(instance) + Constants.ZFATE,
ZooReaderWriter.getRetryingInstance()), 1000 * 60 * 60 * 8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public long isReady(long tid, Master master) throws Exception {
Constants.METADATA_DIRECTORY_COLUMN.fetch(scanner);
scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);

// TODO since not using tablet iterator, are there any issues w/ splits merges?
long t1 = System.currentTimeMillis();
RowIterator ri = new RowIterator(scanner);

Expand Down
Loading

0 comments on commit ca10f6d

Please sign in to comment.