EMMA Coverage Report (generated Thu Jan 20 11:39:44 EST 2011)
[all classes][com.hammurapi.store]

COVERAGE SUMMARY FOR SOURCE FILE [Index.java]

nameclass, %method, %block, %line, %
Index.java100% (1/1)75%  (3/4)93%  (65/70)96%  (5.8/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Index$Type100% (1/1)75%  (3/4)93%  (65/70)96%  (5.8/6)
valueOf (String): Index$Type 0%   (0/1)0%   (0/5)0%   (0/1)
<static initializer> 100% (1/1)100% (44/44)100% (5/5)
Index$Type (String, int): void 100% (1/1)100% (5/5)100% (1/1)
values (): Index$Type [] 100% (1/1)100% (16/16)100% (1/1)

1package com.hammurapi.store;
2 
3import java.util.Comparator;
4 
5import com.hammurapi.extract.Extractor;
6import com.hammurapi.extract.Predicate;
7 
8/**
9 * Store.addIndex() returns object which implements one or 
10 * more of Index sub-interfaces. Index instances are used
11 * to directly leverage index functionality without going through
12 * Store.get() methods.
13 * @author Pavel Vlasov
14 *
15 * This interface extends Iterable. Iterator returned by index
16 * iterates over objects in the store which match index predicate 
17 * and in the order, if the index is ordered. Iteration over indices shall be 
18 * performed within store's read lock.
19 * @param <T>
20 */
21public interface Index<T,PK,V,S extends Store<T,PK,S>> extends Iterable<T> {
22        
23        enum Type {
24                /**
25                 * Unique index is evaluated as part of insert/update (synchronously). 
26                 * If uniqueness is violated, exception is thrown and insert/update is
27                 * not executed.
28                 */
29                UNIQUE,
30                /**
31                 * Synchronous indices as evaluated as part of insert/update (by writer).
32                 * If index extractor throws an exception, this exception is propagated
33                 * to the caller and insert/update operation doesn't get executed.
34                 */
35                SYNCHRONOUS,
36                /**
37                 * Asynchronous index modifications get evaluated in a separate task.
38                 * If reader accesses the index before the index update task goes to
39                 * execution, index update is performed as part of the access operation (by reader). 
40                 * If index extractor throws exception, then index gets marked as 
41                 * corrupted and is removed from the store. If the reader
42                 * accesses the index directly through one of index interfaces, 
43                 * then the exception is propagated to the caller code.
44                 * All operations on a corrupted index result in exception.
45                 */
46                ASYNCHRONOUS,
47                /**
48                 * Lazy index modifications get queued and are evaluated
49                 * as part of the access operation (by reader). If index 
50                 * extractor throws exception, then index gets marked as 
51                 * corrupted and is removed from the store. If the reader
52                 * accesses the index directly through one of index interfaces, 
53                 * then the exception is propagated to the caller code.
54                 * All operations on a corrupted index result in exception.
55                 */
56                LAZY
57                
58        }        
59 
60        /**
61         * @return Back-link to the store.
62         */
63        S getStore();
64        
65        Predicate<T,S> getPredicate();
66        
67        Extractor<T, V, S> getExtractor();
68        
69        boolean isUnique();
70        
71        boolean isOrdered();
72        
73        Comparator<V> getComparator();        
74}

[all classes][com.hammurapi.store]
EMMA 2.0.5312 EclEmma Fix 2 (C) Vladimir Roubtsov