diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/connectors/src/data/io/csv/CSVDataReader.java | 1 | ||||
-rw-r--r-- | src/connectors/src/data/io/ldap/LDAPConnectionWrapper.java | 3 | ||||
-rw-r--r-- | src/connectors/src/data/io/ldap/LDAPFlatDataReader.java | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/connectors/src/data/io/csv/CSVDataReader.java b/src/connectors/src/data/io/csv/CSVDataReader.java index 6dbc8ff..1c09ca0 100644 --- a/src/connectors/src/data/io/csv/CSVDataReader.java +++ b/src/connectors/src/data/io/csv/CSVDataReader.java @@ -227,6 +227,7 @@ public class CSVDataReader extends AbstractMVDataReader { CSVRecord res = null; boolean abort = !csvIt.hasNext(); boolean done = false; + //TODO : re-think logic : csvIt will not return nulls but throws IOException wrapped in RuntimeException while (!abort && !done) { // Try to read a CSV line res = (csvIt.hasNext())?csvIt.next():null; diff --git a/src/connectors/src/data/io/ldap/LDAPConnectionWrapper.java b/src/connectors/src/data/io/ldap/LDAPConnectionWrapper.java index 3f6497b..5c9d70b 100644 --- a/src/connectors/src/data/io/ldap/LDAPConnectionWrapper.java +++ b/src/connectors/src/data/io/ldap/LDAPConnectionWrapper.java @@ -29,6 +29,7 @@ import com.unboundid.ldap.sdk.LDAPConnectionOptions; import com.unboundid.ldap.sdk.LDAPException; import com.unboundid.ldap.sdk.ResultCode; + /** * TODO javadoc * @@ -76,7 +77,7 @@ public class LDAPConnectionWrapper implements Closeable { * @param dataSourceName Short name of this data source (for logging) * @param baseDN Search base DN (will return childs of this DN) * @param keyAttr Attribute name that is the primary key of the entry, identifying the entry in a unique manner - * @param lookAheadAmount Grab this amount of entries at once (in memory-sorted, 128 could be great) + * @param lookAheadAmount Grab this amount of entries at once (in-memory sorted, 128 could be great) * @return A new reader ready to iterate on search results */ public LDAPFlatDataReader newFlatReader(String dataSourceName, String baseDN, String keyAttr, int lookAheadAmount) { diff --git a/src/connectors/src/data/io/ldap/LDAPFlatDataReader.java b/src/connectors/src/data/io/ldap/LDAPFlatDataReader.java index 2cc79a8..dad75d1 100644 --- a/src/connectors/src/data/io/ldap/LDAPFlatDataReader.java +++ b/src/connectors/src/data/io/ldap/LDAPFlatDataReader.java @@ -54,11 +54,12 @@ public class LDAPFlatDataReader extends AbstractMVDataReader { private final String baseDN; private final String keyAttr; private final int lookAheadAmount; - private final SortedSet<String> keys; + private final SortedSet<String> keys; //FIXME : TreeSet is sexy but costly (memory). Use ArrayList<String> or String[] and Collections.sort() private transient Iterator<String> keysItCached; private transient Iterator<String> keysItConsumed; - private transient SortedMap<String, MVDataEntry> entries; + private transient SortedMap<String, MVDataEntry> entries; //TODO : memory ineffcient + // Could help ? http://trove4j.sourceforge.net/javadocs/gnu/trove/map/package-summary.html // Listener to feed LDAP search result in SortedMap without instantiating a big fat SearchResult private final SearchResultListener keysReqListener = new SearchResultListener() { @@ -95,6 +96,7 @@ public class LDAPFlatDataReader extends AbstractMVDataReader { this.keys = new TreeSet<String>(); SearchRequest keysReq = new SearchRequest(keysReqListener, baseDN, SearchScope.ONE, Filter.create("(objectClass=*)"), keyAttr); conn.search(keysReq); + } /** |