类 KeyValueItemWriter<K,​V>

  • 所有已实现的接口:
    ItemWriter<V>, org.springframework.beans.factory.InitializingBean
    直接已知子类:
    GemfireItemWriter

    public abstract class KeyValueItemWriter<K,​V>
    extends java.lang.Object
    implements ItemWriter<V>, org.springframework.beans.factory.InitializingBean
    A base class to implement any ItemWriter that writes to a key value store using a Converter to derive a key from an item
    从以下版本开始:
    2.2
    作者:
    David Turanski
    • 字段概要

      字段 
      修饰符和类型字段说明
      protected booleandelete 
      protected org.springframework.core.convert.converter.Converter<V,​K>itemKeyMapper 
    • 方法概要

      所有方法 实例方法 抽象方法 具体方法 
      修饰符和类型方法说明
      voidafterPropertiesSet() 
      protected abstract voidinit()
      afterPropertiesSet() hook
      voidsetDelete​(boolean delete)
      Sets the delete flag to have the item writer perform deletes
      voidsetItemKeyMapper​(org.springframework.core.convert.converter.Converter<V,​K> itemKeyMapper)
      Set the Converter to use to derive the key from the item
      voidwrite​(java.util.List<? extends V> items)
      Process the supplied data element.
      protected abstract voidwriteKeyValue​(K key, V value)
      Subclasses implement this method to write each item to key value store
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • itemKeyMapper

        protected org.springframework.core.convert.converter.Converter<V,​K> itemKeyMapper
      • delete

        protected boolean delete
    • 方法详细资料

      • write

        public void write​(java.util.List<? extends V> items)
                   throws java.lang.Exception
        从接口复制的说明: ItemWriter
        Process the supplied data element. Will not be called with any null items in normal operation.
        指定者:
        write 在接口中 ItemWriter<K>
        参数:
        items - items to be written
        抛出:
        java.lang.Exception - if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.
      • writeKeyValue

        protected abstract void writeKeyValue​(K key,
                                              V value)
        Subclasses implement this method to write each item to key value store
        参数:
        key - the key
        value - the item
      • init

        protected abstract void init()
        afterPropertiesSet() hook
      • setItemKeyMapper

        public void setItemKeyMapper​(org.springframework.core.convert.converter.Converter<V,​K> itemKeyMapper)
        Set the Converter to use to derive the key from the item
        参数:
        itemKeyMapper - the Converter used to derive a key from an item.
      • setDelete

        public void setDelete​(boolean delete)
        Sets the delete flag to have the item writer perform deletes
        参数:
        delete - if true ItemWriter will perform deletes, if false not to perform deletes.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        指定者:
        afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
        抛出:
        java.lang.Exception