MCPcopy Index your code
hub / github.com/apache/orc / indexOf

Method indexOf

java/tools/src/java/org/apache/orc/tools/FileDump.java:685–702  ·  view source on GitHub ↗
(final byte[] data, final byte[] pattern, final int index)

Source from the content-addressed store, hash-verified

683
684 // search for byte pattern in another byte array
685 public static int indexOf(final byte[] data, final byte[] pattern, final int index) {
686 if (data == null || data.length == 0 || pattern == null || pattern.length == 0 ||
687 index > data.length || index < 0) {
688 return -1;
689 }
690
691 for (int i = index; i < data.length - pattern.length + 1; i++) {
692 boolean found = true;
693 for (int j = 0; j < pattern.length; j++) {
694 if (data[i + j] != pattern[j]) {
695 found = false;
696 break;
697 }
698 }
699 if (found) return i;
700 }
701 return -1;
702 }
703
704 private static String getFormattedBloomFilters(int col, OrcIndex index,
705 OrcFile.WriterVersion version,

Callers 12

testIndexOfMethod · 0.95
recoverFilesMethod · 0.95
findColumnMethod · 0.80
hasBadBloomFiltersMethod · 0.80
setFieldValueMethod · 0.80
getFieldValueMethod · 0.80
uFunction · 0.80
vFunction · 0.80

Calls

no outgoing calls

Tested by 5

testIndexOfMethod · 0.76