You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AsyncObjectSizeQueue.java 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2010, Google Inc. and others
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.lib;
  11. import java.io.IOException;
  12. import org.eclipse.jgit.errors.MissingObjectException;
  13. /**
  14. * Queue to examine object sizes asynchronously.
  15. *
  16. * A queue may perform background lookup of object sizes and supply them
  17. * (possibly out-of-order) to the application.
  18. *
  19. * @param <T>
  20. * type of identifier supplied to the call that made the queue.
  21. */
  22. public interface AsyncObjectSizeQueue<T extends ObjectId> extends
  23. AsyncOperation {
  24. /**
  25. * Position this queue onto the next available result.
  26. *
  27. * @return true if there is a result available; false if the queue has
  28. * finished its input iteration.
  29. * @throws org.eclipse.jgit.errors.MissingObjectException
  30. * the object does not exist. If the implementation is retaining
  31. * the application's objects {@link #getCurrent()} will be the
  32. * current object that is missing. There may be more results
  33. * still available, so the caller should continue invoking next
  34. * to examine another result.
  35. * @throws java.io.IOException
  36. * the object store cannot be accessed.
  37. */
  38. boolean next() throws MissingObjectException, IOException;
  39. /**
  40. * <p>getCurrent.</p>
  41. *
  42. * @return the current object, null if the implementation lost track.
  43. * Implementations may for performance reasons discard the caller's
  44. * ObjectId and provider their own through {@link #getObjectId()}.
  45. */
  46. T getCurrent();
  47. /**
  48. * Get the ObjectId of the current object. Never null.
  49. *
  50. * @return the ObjectId of the current object. Never null.
  51. */
  52. ObjectId getObjectId();
  53. /**
  54. * Get the size of the current object.
  55. *
  56. * @return the size of the current object.
  57. */
  58. long getSize();
  59. }