Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-2805 Top level implementation of the DeletedMessageVault
  3. JAMES-2809

DeletedMessageVault implementation of append & search (full scan version) on top of BlobStore

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.4.0
    • deletedMessageVault
    • None

    Description

      You will write a BlobStore based DeletedMessageVault implementation where it has:

      • a dedicated component(DeletedMessageMetadataVault) to store metadata in order to have reasonable searching performance (JAMES-2807)
      • the capability of choosing bucket in BlobStore as the proposal JAMES-2806 described
      1. Append
        you also have to implement a related method loadMimeMessage()
      class BlobStoreDeletedMessageVault implements DeletedMessageVault {
          private final DeletedMessageMetadataVault metadataVault;
          private final BlobStore blobStore;
      
          Mono<Void> append(User user, DeletedMessage message, InputStream mimeMessage) {
              BlobId deletedMessageFileName = calculateFileName(message);
              blobStore
                  .store(mimeMessage, deletedMessageFileName, calculateCurrentBucket());
              metadataVault.store(calculateCurrentBucket(), message);
          }
      
          Mono<InputStream> loadMimeMessage(User user, MessageId messageId) {
              ....
          }
      }
      

      Pattern for BucketName: `deletedMessages-2019-06-01` where 2019 is the year and 06 the month. 01 is used to later allow smaller bucket definition.

      1. Searching ontop of DeletedMessageMetadataVault JAMES-2807
      • retrieve all available buckets from DeletedMessageMetadataVault
      • for each bucket, use retrieve all deleted message metadata of corresponding user
      • filter records match with query criteria
      class BlobStoreDeletedMessageVault implements DeletedMessageVault {
          
          private DeletedMessageMetadataVault metadataVault;
      
          Flux<DeletedMessage> search(User user, Query query) {
              return metadataVault.listContainers()
                  .flatMap(containerName -> metadataVault.listMessages(containerName, user))
                  .filter(deletedMessage -> matches(deletedMessage, query));
          }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            btellier Benoit Tellier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: