package journal.schema; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Table { private List<TableVersion> versions = new ArrayList<TableVersion>(); private List<Index> indeces = new ArrayList<Index>(); private String name; public Table(String name) { this.name = name; } public void addVersion(TableVersion version) { versions.add(version); } public TableVersion getVersion(int version) { return versions.get(version); } public String getName() { return name; } public void addIndex(String columnName, boolean ascending) { Index index = new Index(columnName, ascending); verifyIndex(index); indeces.add(index); } public List<Index> getIndeces() { return Collections.unmodifiableList(indeces); } // Paranoia method - verify that the index tags an attribute // that exists in all TableVersions private void verifyIndex(Index index) { for (TableVersion tableVersion : versions) { Attribute attr = tableVersion.getAttributeByName(index.getName()); if (attr == null) { throw new IllegalArgumentException("verifyIndex failed: " + index + " not found in " + tableVersion); } } } public String toString() { StringBuffer buf = new StringBuffer("Table : " + name); for (TableVersion version : versions) { buf.append('\n'); buf.append(version); } return buf.toString(); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 8025 | Sven Erik Knop | Removed a couple of warnings. | ||
#1 | 7589 | Sven Erik Knop | Rescue attempt to recover missing files from the JournalReader | ||
//guest/sven_erik_knop/JournalReader/src/journal/schema/Table.java | |||||
#2 | 7375 | Sven Erik Knop |
Major update of the JournalReader. Complete rewrite of the command line parsing Change in the options parsing within the journal reader New SQLLoader action. Currently only against MySQL (needs MySQL JDBC driver) with fixed database and user name. This will be replaced by a config file at some stage. |
||
#1 | 7374 | Sven Erik Knop | Rename/move file(s) - correct location for Eclipse project | ||
//guest/sven_erik_knop/JournalReader/journal/schema/Table.java | |||||
#1 | 6467 | Sven Erik Knop |
Added JournalReader, a Java library of useful tools to read and process checkpoints and journals. Added are a readme.txt to explain some details, and a jar file that contains the compiled class files. The programs will need Java 1.6 to run. |