1 /** 2 * 3 */ 4 package org.treetank.api; 5 6 import java.io.DataOutput; 7 8 import org.treetank.exception.TTIOException; 9 10 import com.google.common.hash.Funnel; 11 12 /** 13 * Overall {@link IData}-Interface for the interaction with the bucket-layer. All 14 * persistence functionality must be handled over this interface while all 15 * data-layers interfaces inherit from this interface. 16 * 17 * @author Sebastian Graf, University of Konstanz 18 * 19 */ 20 public interface IData { 21 22 /** 23 * Serializing to given dataput 24 * 25 * @param pOutput 26 * to serialize to 27 * @throws TTIOException 28 */ 29 void serialize(final DataOutput pOutput) throws TTIOException; 30 31 /** 32 * Gets unique {@link IData} key. 33 * This key should be set over the <code>IBucketWriteTrx.incrementDataKey</code> for getting the correct 34 * offset 35 * within retrievals. 36 * 37 * @return datakey 38 */ 39 long getDataKey(); 40 41 /** 42 * Getting a Funnel for computing guava-based hashes. 43 * 44 * @return a Funnel for this {@link IData} 45 */ 46 Funnel<IData> getFunnel(); 47 48 }