Class ResourceBatchingManager

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class ResourceBatchingManager
    extends java.lang.Object
    implements java.lang.AutoCloseable
    This class lets other modules submit their CRUD methods to it. This class will then supply a single transaction to such CRUD methods of the subscribers, on which such subscribers write data to that transaction. Finally the framework attempts to reliably write this single transaction which represents a batch of an ordered list of entities owned by that subscriber, to be written/updated/removed from a specific datastore as registered by the subscriber.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void delete​(java.lang.String resourceType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier)  
      com.google.common.util.concurrent.ListenableFuture<java.lang.Void> delete​(ResourceBatchingManager.ShardResource shardResource, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier)  
      void deregisterBatchableResource​(java.lang.String resourceType)  
      static ResourceBatchingManager getInstance()  
      void merge​(java.lang.String resourceType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier, org.opendaylight.yangtools.yang.binding.DataObject updatedData)  
      com.google.common.util.concurrent.ListenableFuture<java.lang.Void> merge​(ResourceBatchingManager.ShardResource shardResource, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier, org.opendaylight.yangtools.yang.binding.DataObject updatedData)  
      void put​(java.lang.String resourceType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier, org.opendaylight.yangtools.yang.binding.DataObject updatedData)  
      com.google.common.util.concurrent.ListenableFuture<java.lang.Void> put​(ResourceBatchingManager.ShardResource shardResource, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier, org.opendaylight.yangtools.yang.binding.DataObject updatedData)  
      <T extends org.opendaylight.yangtools.yang.binding.DataObject>
      com.google.common.util.concurrent.FluentFuture<java.util.Optional<T>>
      read​(java.lang.String resourceType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> identifier)
      Reads the identifier of the given resource type.
      void registerBatchableResource​(java.lang.String resourceType, java.util.concurrent.BlockingQueue<ActionableResource<?>> resQueue, ResourceHandler resHandler)  
      void registerDefaultBatchHandlers​(org.opendaylight.mdsal.binding.api.DataBroker broker)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourceBatchingManager

        public ResourceBatchingManager()
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • registerBatchableResource

        public void registerBatchableResource​(java.lang.String resourceType,
                                              java.util.concurrent.BlockingQueue<ActionableResource<?>> resQueue,
                                              ResourceHandler resHandler)
      • registerDefaultBatchHandlers

        public void registerDefaultBatchHandlers​(org.opendaylight.mdsal.binding.api.DataBroker broker)
      • read

        public <T extends org.opendaylight.yangtools.yang.binding.DataObject> com.google.common.util.concurrent.FluentFuture<java.util.Optional<T>> read​(java.lang.String resourceType,
                                                                                                                                                         org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> identifier)
                                                                                                                                                  throws java.lang.InterruptedException,
                                                                                                                                                         java.util.concurrent.ExecutionException
        Reads the identifier of the given resource type. Not to be used by the applications which uses their own resource queue
        Type Parameters:
        T - DataObject subclass
        Parameters:
        resourceType - resource type that was registered with batch manager
        identifier - identifier to be read
        Returns:
        a CheckFuture containing the result of the read
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • merge

        public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> merge​(ResourceBatchingManager.ShardResource shardResource,
                                                                                        org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier,
                                                                                        org.opendaylight.yangtools.yang.binding.DataObject updatedData)
      • merge

        public void merge​(java.lang.String resourceType,
                          org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier,
                          org.opendaylight.yangtools.yang.binding.DataObject updatedData)
      • delete

        public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> delete​(ResourceBatchingManager.ShardResource shardResource,
                                                                                         org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier)
      • delete

        public void delete​(java.lang.String resourceType,
                           org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier)
      • put

        public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> put​(ResourceBatchingManager.ShardResource shardResource,
                                                                                      org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier,
                                                                                      org.opendaylight.yangtools.yang.binding.DataObject updatedData)
      • put

        public void put​(java.lang.String resourceType,
                        org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> identifier,
                        org.opendaylight.yangtools.yang.binding.DataObject updatedData)
      • deregisterBatchableResource

        public void deregisterBatchableResource​(java.lang.String resourceType)