|
20 | 20 |
|
21 | 21 | import org.apache.hadoop.classification.InterfaceAudience; |
22 | 22 | import org.apache.hadoop.classification.InterfaceStability; |
| 23 | +import org.apache.hadoop.fs.Options; |
23 | 24 | import org.apache.hadoop.security.ssl.DelegatingSSLSocketFactory; |
24 | 25 |
|
25 | 26 | import java.util.concurrent.TimeUnit; |
@@ -602,37 +603,69 @@ private Constants() { |
602 | 603 | public static final String READAHEAD_RANGE = "fs.s3a.readahead.range"; |
603 | 604 | public static final long DEFAULT_READAHEAD_RANGE = 64 * 1024; |
604 | 605 |
|
| 606 | + /** |
| 607 | + * The threshold at which drain operations switch |
| 608 | + * to being asynchronous with the schedule/wait overhead |
| 609 | + * compared to synchronous. |
| 610 | + * Value: {@value} |
| 611 | + */ |
| 612 | + public static final String ASYNC_DRAIN_THRESHOLD = "fs.s3a.input.async.drain.threshold"; |
| 613 | + |
| 614 | + /** |
| 615 | + * This is a number based purely on experimentation in |
| 616 | + * {@code ITestS3AInputStreamPerformance}. |
| 617 | + * Value: {@value} |
| 618 | + */ |
| 619 | + public static final int DEFAULT_ASYNC_DRAIN_THRESHOLD = 16_000; |
| 620 | + |
605 | 621 | /** |
606 | 622 | * Which input strategy to use for buffering, seeking and similar when |
607 | 623 | * reading data. |
608 | 624 | * Value: {@value} |
609 | 625 | */ |
610 | | - @InterfaceStability.Unstable |
611 | 626 | public static final String INPUT_FADVISE = |
612 | 627 | "fs.s3a.experimental.input.fadvise"; |
613 | 628 |
|
| 629 | + /** |
| 630 | + * The default value for this FS. |
| 631 | + * Which for S3A, is adaptive. |
| 632 | + * Value: {@value} |
| 633 | + * @deprecated use the {@link Options.OpenFileOptions} value |
| 634 | + * in code which only needs to be compiled against newer hadoop |
| 635 | + * releases. |
| 636 | + */ |
| 637 | + public static final String INPUT_FADV_DEFAULT = |
| 638 | + Options.OpenFileOptions.FS_OPTION_OPENFILE_READ_POLICY_DEFAULT; |
| 639 | + |
614 | 640 | /** |
615 | 641 | * General input. Some seeks, some reads. |
| 642 | + * The policy name "default" is standard across different stores, |
| 643 | + * and should be preferred. |
616 | 644 | * Value: {@value} |
617 | 645 | */ |
618 | | - @InterfaceStability.Unstable |
619 | 646 | public static final String INPUT_FADV_NORMAL = "normal"; |
620 | 647 |
|
621 | 648 | /** |
622 | 649 | * Optimized for sequential access. |
623 | 650 | * Value: {@value} |
| 651 | + * @deprecated use the {@link Options.OpenFileOptions} value |
| 652 | + * in code which only needs to be compiled against newer hadoop |
| 653 | + * releases. |
624 | 654 | */ |
625 | | - @InterfaceStability.Unstable |
626 | | - public static final String INPUT_FADV_SEQUENTIAL = "sequential"; |
| 655 | + public static final String INPUT_FADV_SEQUENTIAL = |
| 656 | + Options.OpenFileOptions.FS_OPTION_OPENFILE_READ_POLICY_SEQUENTIAL; |
627 | 657 |
|
628 | 658 | /** |
629 | 659 | * Optimized purely for random seek+read/positionedRead operations; |
630 | 660 | * The performance of sequential IO may be reduced in exchange for |
631 | 661 | * more efficient {@code seek()} operations. |
632 | 662 | * Value: {@value} |
| 663 | + * @deprecated use the {@link Options.OpenFileOptions} value |
| 664 | + * in code which only needs to be compiled against newer hadoop |
| 665 | + * releases. |
633 | 666 | */ |
634 | | - @InterfaceStability.Unstable |
635 | | - public static final String INPUT_FADV_RANDOM = "random"; |
| 667 | + public static final String INPUT_FADV_RANDOM = |
| 668 | + Options.OpenFileOptions.FS_OPTION_OPENFILE_READ_POLICY_RANDOM; |
636 | 669 |
|
637 | 670 | /** |
638 | 671 | * Gauge name for the input policy : {@value}. |
|
0 commit comments