Reading partial data from Store

compared with
Current by Victor Serbo
on Apr 03, 2007 10:40.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 6 changes. View first change.

 Here is a set of interfaces that would allow reading partial data from the AIDA Store.
 AIDA object would now have to manage its own data - retrieve missing data from the Store when needed, allow data parts that are not currently in use to be Garbage-Collected, backup temporary data to the Store.
  
 {code}
 
 /**
  * Since the AIDA IManagedObjects in ITree don't know their own paths,
  * we have to pass the object to the Store. Store must be able to determine
  * the ITree path of the object and path (or some sort of ID) of the corresponding
  * data in the storage
  */ 
  
 public interface IPartialDataStore extends OnDemandStore {
  
  /**
  * To be used with any simple AIDA object that has no
  * internal structure, like: ICloud, IDataPointSet, IHstogram
  */
  
IPatialData partialData(Object aidaObject, int row);
  IPatialData readPartialData(IManagedObject aidaObject, int row);
  
  
  /**
  * To be used with AIDA objects that has internal structure,
  * like: ITuple
  */
  
IComplexPatialData complexPartialData(Object aidaObject, String pathInObject, int[] rows);
  IComplexPatialData readComplexPartialData(IManagedObject aidaObject, String pathInObject, int[] rows);
  
 
   /**
  * Writes partial data to the Store.
  * This method might be called by the implementation of the particular
  * IManagedObject when part of its data is Garbage-Collected and Finalized
  */
  
  void writePartialData(IManagedObject mo, IPartialData pd) throws IOException; 
  
  
  /**
  * Writes complex partial data to the Store
  * This method might be called by the implementation of the particular
  * IManagedObject when part of its data is Garbage-Collected and Finalized
  */
  
  void writeComplexPartialData(IManagedObject mo, IComplexPartialData pd) throws IOException;
  
 }
  
  
 public interface IPatialData {
  
  int startIndex();
  int endIndex();
  String type();
  Object data();
  
 }
  
 public interface IComplexPatialData {
  
  int[] startIndices();
  int[] endIndices();
  String pathInObject();
  String type();
  Object data();
  
 }
 {code}
 Main problem with this approach is that AIDA object that requested the partial data does not know what is it getting back - it would need to cast generic Object to something specific, like ICloud, double\[\], etc.