id
int64
0
1.29M
original_id
stringlengths
32
32
swhid
stringlengths
100
170
sha1
stringlengths
40
40
repo_name
stringlengths
2
45
repo_group
stringclasses
12 values
filepath
stringlengths
5
153
name
stringlengths
1
14.9k
type
stringclasses
3 values
code
stringlengths
7
2.12M
16,500
1feb02cdb6eee30a3011ce8b73d51b66
swh:1:cnt:383db88ee513aebf55f949d162e8eb37d650866c;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=72-84/
0dfc1c94701a669dfddb8e42b4f33e6ebc2ba0e4
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/CamusSweeperPlanner.java
CamusSweeperPlanner::pathListToCommaSeperated(List<Path> list)
function
protected String pathListToCommaSeperated(List<Path> list) { ArrayList<Path> tmpList = new ArrayList<Path>(); tmpList.addAll(list); StringBuilder sb = new StringBuilder(tmpList.get(0).toString()); tmpList.remove(0); for (Path p : tmpList) { sb.append(",").append(p.toString()); } ret...
16,501
7c627fa30b84b1a3a8d0850061196766
swh:1:cnt:383db88ee513aebf55f949d162e8eb37d650866c;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=22-26/
0dfc1c94701a669dfddb8e42b4f33e6ebc2ba0e4
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/CamusSweeperPlanner.java
CamusSweeperPlanner::setPropertiesLogger(Properties props, Logger log)
function
public CamusSweeperPlanner setPropertiesLogger(Properties props, Logger log) { this.props = props; this.log = log; return this; }
16,502
8d9f0b7cf5c80435e09ae9cbb26bcb8c
swh:1:cnt:383db88ee513aebf55f949d162e8eb37d650866c;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=31-32/
0dfc1c94701a669dfddb8e42b4f33e6ebc2ba0e4
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/CamusSweeperPlanner.java
CamusSweeperPlanner::createSweeperJobProps(String topic, Path inputDir, Path outputDir, FileSystem fs, CamusSweeperMetrics metrics)
function
protected abstract List<Properties> createSweeperJobProps(String topic, Path inputDir, Path outputDir, FileSystem fs, CamusSweeperMetrics metrics) throws IOException;
16,503
a308f9442f419db39d1c56ffb3f9f1df
swh:1:cnt:383db88ee513aebf55f949d162e8eb37d650866c;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=52-70/
0dfc1c94701a669dfddb8e42b4f33e6ebc2ba0e4
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/CamusSweeperPlanner.java
CamusSweeperPlanner::shouldReprocess(FileSystem fs, Path source, long destinationModTime)
function
private boolean shouldReprocess(FileSystem fs, Path source, long destinationModTime) throws IOException { FileStatus sourceStatus = fs.getFileStatus(source); log.debug("source mod:" + sourceStatus.getModificationTime()); log.debug("dest mod:" + destinationModTime); if (sourceStatus.getModificationTime...
16,504
26cd95a88d0ca98d8eb80b185b967661
swh:1:cnt:383db88ee513aebf55f949d162e8eb37d650866c;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=86-88/
0dfc1c94701a669dfddb8e42b4f33e6ebc2ba0e4
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/CamusSweeperPlanner.java
CamusSweeperPlanner::getOutlierProperties()
function
public Set<Properties> getOutlierProperties() { return this.outlierProperties; }
16,505
64d295d83d803f450a160aa69d661890
swh:1:cnt:383db88ee513aebf55f949d162e8eb37d650866c;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=90-98/
0dfc1c94701a669dfddb8e42b4f33e6ebc2ba0e4
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/CamusSweeperPlanner.java
CamusSweeperPlanner::waitUntilReadyToProcess(Properties jobProps, FileSystem fs)
function
/** * Blocks processing of a job until the input is ready. * By default, will return immediately and proceed with the job. * @param jobProps Job properties. * @return true to proceed with the job, false to cancel the job. */ protected boolean waitUntilReadyToProcess(Properties jobProps, FileSystem fs) ...
16,506
397f5a1dbf3d8e7f765b4797c38e582a
swh:1:cnt:effed28e00b2f2872e27d769efe5586eed0ee616;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=6-15/
45d5d2a26e2ba3901df94d87f1a864a3131b2d60
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/HiddenFilter.java
HiddenFilter
type
/** * Filter a path if the path name starts with '_' or '.' */ public class HiddenFilter implements PathFilter { @Override public boolean accept(Path path) { String name = path.getName(); return !(name.startsWith("_") || name.startsWith(".")); } }
16,507
6e521a457a78a7d62030f382b2cce4ee
swh:1:cnt:effed28e00b2f2872e27d769efe5586eed0ee616;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=10-14/
45d5d2a26e2ba3901df94d87f1a864a3131b2d60
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/HiddenFilter.java
HiddenFilter::accept(Path path)
function
@Override public boolean accept(Path path) { String name = path.getName(); return !(name.startsWith("_") || name.startsWith(".")); }
16,508
035d2d0259f34ed60ac7e2eed75f7b5c
swh:1:cnt:6f6a758a9b271f0775bd3751595398b91b411012;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=15-19/
8197c99bac55eea35621b15db1733d4886f1913e
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/JobCancelledException.java
JobCancelledException
type
public class JobCancelledException extends Exception { public JobCancelledException(String message) { super(message); } }
16,509
22516a4e0cabddf28db77af7e58ef118
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=31-158/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat
type
public class AvroKeyCombineFileInputFormat extends CombineFileInputFormat<AvroKey<GenericRecord>, NullWritable> { private static final long GET_SPLIT_NUM_FILES_TRHESHOLD_DEFAULT = 5000; @Override public List<InputSplit> getSplits(JobContext arg0) throws IOException { FileSystem fs = FileSystem.get(arg0.getCo...
16,510
36f352a18ba4395ddf21ff31451f88a9
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=110-156/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::AvroKeyCombineFileReader
type
public static class AvroKeyCombineFileReader extends RecordReader<AvroKey<GenericRecord>, NullWritable> { AvroKeyRecordReader<GenericRecord> innerReader; CombineFileSplit split; TaskAttemptContext context; Integer idx; public AvroKeyCombineFileReader(CombineFileSplit split, TaskAttemptContext arg1,...
16,511
007da4470dedd922900250a34255af4a
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=92-101/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::addAllAvro(List<Path> files, List<Path> dirs, FileSystem fs)
function
private void addAllAvro(List<Path> files, List<Path> dirs, FileSystem fs) throws FileNotFoundException, IOException { for (Path dir : dirs) { for (FileStatus f : fs.listStatus(dir)) { if (f.isDir()) addAllAvro(files, Collections.singletonList(f.getPath()), fs); else if (f.getPath().g...
16,512
f7d520ba1da4365f266ec58c5af056d0
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=131-134/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::AvroKeyCombineFileReader::getCurrentKey()
function
@Override public AvroKey<GenericRecord> getCurrentKey() throws IOException, InterruptedException { return innerReader.getCurrentKey(); }
16,513
9f0f05a9da1581a4285cacd0ff1854a8
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=141-144/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::AvroKeyCombineFileReader::getProgress()
function
@Override public float getProgress() throws IOException, InterruptedException { return innerReader.getProgress(); }
16,514
a3b5481ca27d8a5d30a81d86a8bbc3d2
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=34-58/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::getSplits(JobContext arg0)
function
@Override public List<InputSplit> getSplits(JobContext arg0) throws IOException { FileSystem fs = FileSystem.get(arg0.getConfiguration()); super.setMaxSplitSize(arg0.getConfiguration().getLong("mapred.max.split.size", 471859200)); super.setMinSplitSizeNode(arg0.getConfiguration().getLong("mapred.min.spli...
16,515
949759c0b2a9c3071e53a2757e6c1c5a
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=126-129/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::AvroKeyCombineFileReader::close()
function
@Override public void close() throws IOException { innerReader.close(); }
16,516
3c46c680cc0bb8ee652abc85cb1c1f2d
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=103-108/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::createRecordReader(InputSplit arg0, TaskAttemptContext arg1)
function
@Override public RecordReader<AvroKey<GenericRecord>, NullWritable> createRecordReader(InputSplit arg0, TaskAttemptContext arg1) throws IOException { return new CombineFileRecordReader<AvroKey<GenericRecord>, NullWritable>((CombineFileSplit) arg0, arg1, AvroKeyCombineFileReader.class); }
16,517
af133b9031b2ca0e90e7c7db0494cf2c
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=60-90/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::addAllSplits(JobContext job, List<Path> dirs, List<InputSplit> splits, FileSystem fs)
function
private void addAllSplits(JobContext job, List<Path> dirs, List<InputSplit> splits, FileSystem fs) throws FileNotFoundException, IOException { List<Path> subdirs = new ArrayList<Path>(); long fileCount = 0; for (Path input : dirs) { long count = fs.getContentSummary(input).getFileCount(); ...
16,518
571dd7c08da0966684bce8f465fd1db0
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=136-139/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::AvroKeyCombineFileReader::getCurrentValue()
function
@Override public NullWritable getCurrentValue() throws IOException, InterruptedException { return innerReader.getCurrentValue(); }
16,519
3092ae18d03ca9c26e010d451af1be35
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=146-149/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::AvroKeyCombineFileReader::initialize(InputSplit arg0, TaskAttemptContext arg1)
function
@Override public void initialize(InputSplit arg0, TaskAttemptContext arg1) throws IOException, InterruptedException { innerReader.initialize(new FileSplit(split.getPath(idx), split.getOffset(idx), split.getLength(idx), null), arg1); }
16,520
33a5f49bbed66a0e43cde1e2a95d4fef
swh:1:cnt:f5893ff8afe576bfecccda7cfd5c0eae6afb2db4;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=151-154/
96217e04e40a1b19dd89cdc402c6bed2f1fb676f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyCombineFileInputFormat.java
AvroKeyCombineFileInputFormat::AvroKeyCombineFileReader::nextKeyValue()
function
@Override public boolean nextKeyValue() throws IOException, InterruptedException { return innerReader.nextKeyValue(); }
16,521
bf46df0655bb192876efe44ef3c78bc0
swh:1:cnt:0a787dde3ec063117ae2c490e595500cbeb643d5;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=21-94/
2e96cfe2c0db2909aa87c853fefd9d3d652ce48e
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyMapper.java
AvroKeyMapper
type
public class AvroKeyMapper extends Mapper<AvroKey<GenericRecord>, NullWritable, AvroKey<GenericRecord>, Object> { private static final Log LOG = LogFactory.getLog(AvroKeyMapper.class.getName()); private AvroKey<GenericRecord> outKey; private AvroValue<GenericRecord> outValue; private boolean mapOnly = false; ...
16,522
c78986bf96d2c9ff2446c30aa0fc859a
swh:1:cnt:0a787dde3ec063117ae2c490e595500cbeb643d5;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=29-48/
2e96cfe2c0db2909aa87c853fefd9d3d652ce48e
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyMapper.java
AvroKeyMapper::setup(Context context)
function
@Override protected void setup(Context context) throws IOException, InterruptedException { // For class path debugging LOG.info("classpath: " + System.getProperty("java.class.path")); ClassLoader loader = AvroKeyMapper.class.getClassLoader(); LOG.info("com.linkedin.events.fixed_16: " + loader.getResou...
16,523
e8977e7bf220bfd747c6251a765233e5
swh:1:cnt:0a787dde3ec063117ae2c490e595500cbeb643d5;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=50-60/
2e96cfe2c0db2909aa87c853fefd9d3d652ce48e
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyMapper.java
AvroKeyMapper::map(AvroKey<GenericRecord> key, NullWritable value, Context context)
function
@Override protected void map(AvroKey<GenericRecord> key, NullWritable value, Context context) throws IOException, InterruptedException { if (mapOnly) { context.write(key, NullWritable.get()); } else { outValue.datum(key.datum()); projectData(key.datum(), outKey.datum()); context....
16,524
2eecf4f788ece817063bb5fc3c0b5838
swh:1:cnt:0a787dde3ec063117ae2c490e595500cbeb643d5;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=62-92/
2e96cfe2c0db2909aa87c853fefd9d3d652ce48e
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyMapper.java
AvroKeyMapper::projectData(GenericRecord source, GenericRecord target)
function
private void projectData(GenericRecord source, GenericRecord target) { for (Field fld : target.getSchema().getFields()) { if (fld.schema().getType() == Type.UNION) { Object obj = source.get(fld.name()); Schema sourceSchema = GenericData.get().induce(obj); if (sourceSchema.getType() == ...
16,525
ffbf5a85c9063470a6a9b3c734e1ed6a
swh:1:cnt:1a440ebaac7d85c69f69ae57cda31f2628bd75a5;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=12-46/
f693cf75eaa138400256b32e0987ed3dbc3f03b8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyReducer.java
AvroKeyReducer
type
public class AvroKeyReducer extends Reducer<AvroKey<GenericRecord>, AvroValue<GenericRecord>, AvroKey<GenericRecord>, NullWritable> { public static enum EVENT_COUNTER { MORE_THAN_1, DEDUPED, RECORD_COUNT }; private AvroKey<GenericRecord> outKey; @Override protected void setup(Context contex...
16,526
205705ddcf2b49afc4fb9f22516104cd
swh:1:cnt:1a440ebaac7d85c69f69ae57cda31f2628bd75a5;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=15-19/
f693cf75eaa138400256b32e0987ed3dbc3f03b8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyReducer.java
AvroKeyReducer::EVENT_COUNTER
type
public static enum EVENT_COUNTER { MORE_THAN_1, DEDUPED, RECORD_COUNT }
16,527
a42b29598b5475d6226da70f841b4713
swh:1:cnt:1a440ebaac7d85c69f69ae57cda31f2628bd75a5;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=23-26/
f693cf75eaa138400256b32e0987ed3dbc3f03b8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyReducer.java
AvroKeyReducer::setup(Context context)
function
@Override protected void setup(Context context) throws IOException, InterruptedException { outKey = new AvroKey<GenericRecord>(); }
16,528
029a947bcb1183d6865cfe919eb01dd7
swh:1:cnt:1a440ebaac7d85c69f69ae57cda31f2628bd75a5;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=28-45/
f693cf75eaa138400256b32e0987ed3dbc3f03b8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/AvroKeyReducer.java
AvroKeyReducer::reduce(AvroKey<GenericRecord> key, Iterable<AvroValue<GenericRecord>> values, Context context)
function
@Override protected void reduce(AvroKey<GenericRecord> key, Iterable<AvroValue<GenericRecord>> values, Context context) throws IOException, InterruptedException { int numVals = 0; for (AvroValue<GenericRecord> av : values) { outKey.datum(av.datum()); numVals++; } if (numVals > 1) {...
16,529
ef4c789887784a739f74c59ed321460c
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=41-200/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob
type
public class CamusSweeperAvroKeyJob extends CamusSweeperJob { private static final Log LOG = LogFactory.getLog(CamusSweeperAvroKeyJob.class.getName()); @Override public void configureJob(String topic, Job job) { boolean skipNameValidation = RelaxedSchemaUtils.skipNameValidation(job.getConfiguration()); i...
16,530
72b681a8edb7b9a26ee1e34a0e5a3b4d
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=187-198/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::ReverseLastModifiedComparitor
type
class ReverseLastModifiedComparitor implements Comparator<FileStatus> { @Override public int compare(FileStatus o1, FileStatus o2) { if (o2.getModificationTime() < o1.getModificationTime()) return -1; else if (o2.getModificationTime() > o1.getModificationTime()) return 1; else...
16,531
d771be10c99ad4907857931aa743bfa3
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=99-110/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::getAllFieldsExceptMap(Schema schema)
function
private Schema getAllFieldsExceptMap(Schema schema) { List<Field> fields = new ArrayList<Schema.Field>(); for (Field f : schema.getFields()) { if (f.schema().getType() != Schema.Type.MAP) { fields.add(new Field(f.name(), f.schema(), f.doc(), f.defaultValue(), f.order())); } } Schema...
16,532
451e2d520ca03f23e3f97ed70a6d32ee
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=117-135/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::duplicateRecord(Schema record, Schema original)
function
public Schema duplicateRecord(Schema record, Schema original) { List<Field> fields = new ArrayList<Schema.Field>(); for (Field f : record.getFields()) { Schema fldSchema; if (original.getField(f.name()) != null) { fldSchema = original.getField(f.name()).schema(); } else { fldS...
16,533
783f63bcfd618e619fbecf542ba7a936
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=149-167/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::getNewestSchemaFromSource(Job job)
function
private Schema getNewestSchemaFromSource(Job job) throws IOException { FileSystem fs = FileSystem.get(job.getConfiguration()); Path[] sourceDirs = FileInputFormat.getInputPaths(job); List<FileStatus> files = new ArrayList<FileStatus>(); for (Path sourceDir : sourceDirs) { files.addAll(Arrays.asL...
16,534
7b6456948810331a86f94de5a33f1d5a
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=44-97/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::configureJob(String topic, Job job)
function
@Override public void configureJob(String topic, Job job) { boolean skipNameValidation = RelaxedSchemaUtils.skipNameValidation(job.getConfiguration()); if (skipNameValidation) { RelaxedAvroSerialization.addToConfiguration(job.getConfiguration()); } // setting up our input format and map output ...
16,535
6e96e84193e0db1358735781d61290b3
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=112-115/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::validateKeySchema(Schema schema, Schema keySchema)
function
private boolean validateKeySchema(Schema schema, Schema keySchema) { return SchemaCompatibility.checkReaderWriterCompatibility(keySchema, schema).getType() .equals(SchemaCompatibilityType.COMPATIBLE); }
16,536
3f6b1b1c85e022e6f12c63adc8074766
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=137-147/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::setupSchemas(String topic, Job job, Schema schema, Schema keySchema)
function
private void setupSchemas(String topic, Job job, Schema schema, Schema keySchema) { AvroJob.setInputKeySchema(job, schema); AvroJob.setMapOutputKeySchema(job, keySchema); AvroJob.setMapOutputValueSchema(job, schema); Schema reducerSchema = RelaxedSchemaUtils.parseSchema(getConfValue(job, topic...
16,537
db8bdf0f06c8b59b4c25f1c124e0a283
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=169-185/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::getNewestSchemaFromSource(Path sourceDir, FileSystem fs)
function
private Schema getNewestSchemaFromSource(Path sourceDir, FileSystem fs) throws IOException { FileStatus[] files = fs.listStatus(sourceDir); Arrays.sort(files, new ReverseLastModifiedComparitor()); for (FileStatus f : files) { if (f.isDir()) { Schema schema = getNewestSchemaFromSource(f.getPath...
16,538
f24bef02a5ecdace38f2f23370419420
swh:1:cnt:af06d50f7b6fcf2c55cfff42853881839e985f45;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=189-197/
e59384146329d5ac4359eb8d1f16521657ca2b9b
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperAvroKeyJob.java
CamusSweeperAvroKeyJob::ReverseLastModifiedComparitor::compare(FileStatus o1, FileStatus o2)
function
@Override public int compare(FileStatus o1, FileStatus o2) { if (o2.getModificationTime() < o1.getModificationTime()) return -1; else if (o2.getModificationTime() > o1.getModificationTime()) return 1; else return 0; }
16,539
4ffff5b1c080cd5309999e59bf74b3dd
swh:1:cnt:e10a6d07bde6cf2f8a269dbb172c43feea8a58db;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=13-48/
eb3423a47da8c5eeec49f8c956ce707bfc28efec
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperJob.java
CamusSweeperJob
type
@SuppressWarnings("rawtypes") public abstract class CamusSweeperJob { protected Logger log; public CamusSweeperJob setLogger(Logger log) { this.log = log; return this; } public abstract void configureJob(String topic, Job job); protected void configureInput(Job job, Class<? extends InputFormat> inp...
16,540
15abb0ee51fb3001ed34aef78a7a871b
swh:1:cnt:e10a6d07bde6cf2f8a269dbb172c43feea8a58db;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=33-39/
eb3423a47da8c5eeec49f8c956ce707bfc28efec
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperJob.java
CamusSweeperJob::configureOutput(Job job, Class<? extends OutputFormat> outputFormat, Class<? extends Reducer> reducer, Class<?> outKey, Class<?> outValue)
function
protected void configureOutput(Job job, Class<? extends OutputFormat> outputFormat, Class<? extends Reducer> reducer, Class<?> outKey, Class<?> outValue) { job.setOutputFormatClass(outputFormat); job.setReducerClass(reducer); job.setOutputKeyClass(outKey); job.setOutputValueClass(outValue); }
16,541
4517e538fe92af8f0783b174a1fddf9c
swh:1:cnt:e10a6d07bde6cf2f8a269dbb172c43feea8a58db;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=22-22/
eb3423a47da8c5eeec49f8c956ce707bfc28efec
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperJob.java
CamusSweeperJob::configureJob(String topic, Job job)
function
public abstract void configureJob(String topic, Job job);
16,542
61a036ff26202b9573b8c7938a86f726
swh:1:cnt:e10a6d07bde6cf2f8a269dbb172c43feea8a58db;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=17-20/
eb3423a47da8c5eeec49f8c956ce707bfc28efec
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperJob.java
CamusSweeperJob::setLogger(Logger log)
function
public CamusSweeperJob setLogger(Logger log) { this.log = log; return this; }
16,543
ed26474120a26062838d5352a73bb346
swh:1:cnt:e10a6d07bde6cf2f8a269dbb172c43feea8a58db;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=41-43/
eb3423a47da8c5eeec49f8c956ce707bfc28efec
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperJob.java
CamusSweeperJob::getConfValue(Job job, String topic, String key, String defaultStr)
function
protected String getConfValue(Job job, String topic, String key, String defaultStr) { return job.getConfiguration().get(topic + "." + key, job.getConfiguration().get(key, defaultStr)); }
16,544
f01d263b42831af3d77595f8c1c4604b
swh:1:cnt:e10a6d07bde6cf2f8a269dbb172c43feea8a58db;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=24-31/
eb3423a47da8c5eeec49f8c956ce707bfc28efec
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperJob.java
CamusSweeperJob::configureInput(Job job, Class<? extends InputFormat> inputFormat, Class<? extends Mapper> mapper, Class<?> mapOutKey, Class<?> mapOutValue)
function
protected void configureInput(Job job, Class<? extends InputFormat> inputFormat, Class<? extends Mapper> mapper, Class<?> mapOutKey, Class<?> mapOutValue) { job.setInputFormatClass(inputFormat); job.setMapperClass(mapper); job.setMapOutputKeyClass(mapOutKey); job.setMapOutputValueClass(mapOutValue...
16,545
7db6c5effc47bca3897e2dfe8166a38a
swh:1:cnt:e10a6d07bde6cf2f8a269dbb172c43feea8a58db;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=45-47/
eb3423a47da8c5eeec49f8c956ce707bfc28efec
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperJob.java
CamusSweeperJob::getConfValue(Job job, String topic, String key)
function
protected String getConfValue(Job job, String topic, String key) { return getConfValue(job, topic, key, null); }
16,546
22dfdd57c46c7460006402409d9fdeb8
swh:1:cnt:ca7822240968f1f26330c0c0a477feab479d9f5f;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=17-64/
98621d1d96a1418782ff4de74a6f478babc6f022
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperOutputCommitter.java
CamusSweeperOutputCommitter
type
/** * A subclass of org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter that uses a custom * output file name: x.y.avro, where x = number of records in the file, y = current time. */ public class CamusSweeperOutputCommitter extends FileOutputCommitter { private static final Logger LOG = LoggerFactory.getLo...
16,547
cd7f6e2fe077189be0c975f377e159f1
swh:1:cnt:ca7822240968f1f26330c0c0a477feab479d9f5f;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=34-46/
98621d1d96a1418782ff4de74a6f478babc6f022
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperOutputCommitter.java
CamusSweeperOutputCommitter::commitTask(TaskAttemptContext context)
function
@Override public void commitTask(TaskAttemptContext context) throws IOException { long recordCount = getRecordCountCounter(context); String fileName = "part-r-" + recordCount + "." + System.currentTimeMillis() + ".avro"; for (FileStatus status : fs.listStatus(super.getWorkPath())) { if (status.getP...
16,548
69468e5a1b4ce684efd5cc16b772dcb8
swh:1:cnt:ca7822240968f1f26330c0c0a477feab479d9f5f;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=48-62/
98621d1d96a1418782ff4de74a6f478babc6f022
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/mapreduce/CamusSweeperOutputCommitter.java
CamusSweeperOutputCommitter::getRecordCountCounter(TaskAttemptContext context)
function
private long getRecordCountCounter(TaskAttemptContext context) { try { //In Hadoop 2, TaskAttemptContext.getCounter() is available Method getCounterMethod = context.getClass().getMethod("getCounter", Enum.class); return ((Counter) getCounterMethod.invoke(context, AvroKeyReducer.EVENT_COUNTER.RECOR...
16,549
95f5cd861b22d09444a21d20f7f1c621
swh:1:cnt:14892d67c29cc7acb2f29ad0a9f5086c8c742c2d;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=11-37/
2e49cbc1a1333e6b207f45027509c40cfd6739a8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/DateUtils.java
DateUtils
type
public class DateUtils { public DateTimeZone zone; public DateTimeFormatter minuteFormatter; public DateUtils(Properties props) { zone = DateTimeZone.forID(props.getProperty("camus.default.timezone", "America/Los_Angeles")); minuteFormatter = getDateTimeFormatter("YYYY-MM-dd-HH-mm"); } public DateTi...
16,550
55b8fb31c38c47837fd85723625731e5
swh:1:cnt:14892d67c29cc7acb2f29ad0a9f5086c8c742c2d;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=20-22/
2e49cbc1a1333e6b207f45027509c40cfd6739a8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/DateUtils.java
DateUtils::getDateTimeFormatter(String str)
function
public DateTimeFormatter getDateTimeFormatter(String str) { return DateTimeFormat.forPattern(str).withZone(zone); }
16,551
064df05a440c832934b86d9e678c2456
swh:1:cnt:14892d67c29cc7acb2f29ad0a9f5086c8c742c2d;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=33-36/
2e49cbc1a1333e6b207f45027509c40cfd6739a8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/DateUtils.java
DateUtils::getCurrentHour()
function
public DateTime getCurrentHour() { DateTime time = new DateTime(zone); return new DateTime(time.getYear(), time.getMonthOfYear(), time.getDayOfMonth(), time.getHourOfDay(), 0, 0, 0, zone); }
16,552
b5fb60636ed18dc1e7a5c6a5474ea58d
swh:1:cnt:14892d67c29cc7acb2f29ad0a9f5086c8c742c2d;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=28-31/
2e49cbc1a1333e6b207f45027509c40cfd6739a8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/DateUtils.java
DateUtils::getMidnight()
function
public DateTime getMidnight() { DateTime time = new DateTime(zone); return new DateTime(time.getYear(), time.getMonthOfYear(), time.getDayOfMonth(), 0, 0, 0, 0, zone); }
16,553
b6ed1755b818f14b54e9004044082fc3
swh:1:cnt:14892d67c29cc7acb2f29ad0a9f5086c8c742c2d;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=24-26/
2e49cbc1a1333e6b207f45027509c40cfd6739a8
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/DateUtils.java
DateUtils::getPartition(long timeGranularityMs, long timestamp)
function
public static long getPartition(long timeGranularityMs, long timestamp) { return (timestamp / timeGranularityMs) * timeGranularityMs; }
16,554
1c5080d2366081e6ddf4e94fa6b6b8b6
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=12-66/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor
type
public class PriorityExecutor extends ThreadPoolExecutor { public PriorityExecutor(int poolsize) { super(poolsize, poolsize, 60L, TimeUnit.SECONDS, new PriorityBlockingQueue<Runnable>(300, new PriorityTaskComparator())); } @Override protected <T> RunnableFuture<T> newTaskFor(final Callable<T> calla...
16,555
b8fee18fcbe40e5c71c133ff5ea52f93
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=34-36/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor::Important
type
public interface Important { int getPriority(); }
16,556
aeef68321a47ce0b23a978dc73c67c6b
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=60-65/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor::PriorityTaskComparator
type
private static class PriorityTaskComparator implements Comparator<Runnable> { @Override public int compare(final Runnable left, final Runnable right) { return ((PriorityTask) left).compareTo((PriorityTask) right); } }
16,557
e7cf4f6a1cc879e57f7d078ecc75060a
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=38-58/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor::PriorityTask
type
private static final class PriorityTask<T> extends FutureTask<T> implements Comparable<PriorityTask<T>> { private final int priority; public PriorityTask(final int priority, final Callable<T> tCallable) { super(tCallable); this.priority = priority; } public PriorityTask(final int priority...
16,558
86de8a563da11f9fab3a6a51c0cd32ae
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=18-24/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor::newTaskFor(final Callable<T> callable)
function
@Override protected <T> RunnableFuture<T> newTaskFor(final Callable<T> callable) { if (callable instanceof Important) return new PriorityTask<T>(((Important) callable).getPriority(), callable); else return new PriorityTask<T>(0, callable); }
16,559
724884dec4387a16615afc9224fc8d32
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=26-32/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor::newTaskFor(final Runnable runnable, final T value)
function
@Override protected <T> RunnableFuture<T> newTaskFor(final Runnable runnable, final T value) { if (runnable instanceof Important) return new PriorityTask<T>(((Important) runnable).getPriority(), runnable, value); else return new PriorityTask<T>(0, runnable, value); }
16,560
7c063b664aa5da60180c366ddb3d720a
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=53-57/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor::PriorityTask::compareTo(final PriorityTask<T> o)
function
@Override public int compareTo(final PriorityTask<T> o) { final long diff = o.priority - priority; return 0 == diff ? 0 : 0 > diff ? -1 : 1; }
16,561
db609806568f0528f3a3abf34726ee00
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=35-35/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor::Important::getPriority()
function
int getPriority();
16,562
74c90f326b8cbbcee944785b990c47b9
swh:1:cnt:167957aa7c1d1ee24d5cf24592949a3409bac3e1;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=61-64/
e3750a9adec1d5a104fd14e5eba3110fa4123940
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/PriorityExecutor.java
PriorityExecutor::PriorityTaskComparator::compare(final Runnable left, final Runnable right)
function
@Override public int compare(final Runnable left, final Runnable right) { return ((PriorityTask) left).compareTo((PriorityTask) right); }
16,563
68b1e1b022ea502a796fd4fc087e8f9d
swh:1:cnt:c867ec8e50331b5d62d53bf031edd158b7f41c2a;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=22-61/
8dd63e925e8cf66a8f17e8ba034dc5d4321531e0
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroKeyOutputFormat.java
RelaxedAvroKeyOutputFormat
type
/** * The AvroKeyOutputFormat class to relax the name validation * * @author hcai * * @param <T> The Java type of the Avro data to serialize. */ public class RelaxedAvroKeyOutputFormat<T> extends AvroKeyOutputFormat<T> { private static final Log LOG = LogFactory.getLog(RelaxedAvroKeyOutputFormat.class.getName(...
16,564
c2c30690791af7679b415b564b1b384a
swh:1:cnt:c867ec8e50331b5d62d53bf031edd158b7f41c2a;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=36-51/
8dd63e925e8cf66a8f17e8ba034dc5d4321531e0
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroKeyOutputFormat.java
RelaxedAvroKeyOutputFormat::getRecordWriter(TaskAttemptContext context)
function
@Override public RecordWriter<AvroKey<T>, NullWritable> getRecordWriter(TaskAttemptContext context) throws IOException { LOG.info("getRecordWriter for" + context); // Get the writer schema. String schemaString = context.getConfiguration().get(CONF_OUTPUT_KEY_SCHEMA); Schema writerSchema = sche...
16,565
2dbe90b91ab3e5e2b2bb47cbc048a4ee
swh:1:cnt:c867ec8e50331b5d62d53bf031edd158b7f41c2a;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=53-59/
8dd63e925e8cf66a8f17e8ba034dc5d4321531e0
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroKeyOutputFormat.java
RelaxedAvroKeyOutputFormat::getOutputCommitter(TaskAttemptContext context)
function
@Override public synchronized OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException { if (this.commiter == null) { this.commiter = new CamusSweeperOutputCommitter(FileOutputFormat.getOutputPath(context), context); } return this.commiter; }
16,566
353d36715166a05e2cd4d8273bdca654
swh:1:cnt:b72fa497fe3a61458e16bcbb7260fe5c172f8d15;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=22-96/
c32c71b519e4b58e1f48ee40921fb5fdfcf8de7f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroSerialization.java
RelaxedAvroSerialization
type
/** * The AvroSerialization class to relax the name validation * * @author hcai * * @param <T> The Java type of the Avro data to serialize. */ public class RelaxedAvroSerialization<T> extends AvroSerialization<T> { private static final Log LOG = LogFactory.getLog(RelaxedAvroSerialization.class.getName()); p...
16,567
e13df9e8ad64568fd3c24f4d5e12c55b
swh:1:cnt:b72fa497fe3a61458e16bcbb7260fe5c172f8d15;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=37-47/
c32c71b519e4b58e1f48ee40921fb5fdfcf8de7f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroSerialization.java
RelaxedAvroSerialization::addToConfiguration(Configuration conf)
function
public static void addToConfiguration(Configuration conf) { Collection<String> serializations = conf.getStringCollection("io.serializations"); if (!serializations.contains(RelaxedAvroSerialization.class.getName())) { LOG.info("Prepending RelaxedAvroSerialization.class"); // prepend RelaxedAvroSerial...
16,568
4e427288de4e47aeb6e4d7ce576a675d
swh:1:cnt:b72fa497fe3a61458e16bcbb7260fe5c172f8d15;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=81-84/
c32c71b519e4b58e1f48ee40921fb5fdfcf8de7f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroSerialization.java
RelaxedAvroSerialization::getValueReaderSchema(Configuration conf)
function
public static Schema getValueReaderSchema(Configuration conf) { String json = conf.get(CONF_VALUE_READER_SCHEMA); return null == json ? null : RelaxedSchemaUtils.parseSchema(json, conf); }
16,569
5cda3e12971470201b2d6f01710ee17d
swh:1:cnt:b72fa497fe3a61458e16bcbb7260fe5c172f8d15;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=63-74/
c32c71b519e4b58e1f48ee40921fb5fdfcf8de7f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroSerialization.java
RelaxedAvroSerialization::getDeserializer(Class<AvroWrapper<T>> c)
function
@Override public Deserializer<AvroWrapper<T>> getDeserializer(Class<AvroWrapper<T>> c) { LOG.info("getDeerializer for " + c); Configuration conf = getConf(); if (AvroKey.class.isAssignableFrom(c)) { return new AvroKeyDeserializer<T>(getKeyWriterSchema(conf), getKeyReaderSchema(conf), conf.getClassLo...
16,570
4d552b30fe7bc09412ee5368b23d8d00
swh:1:cnt:b72fa497fe3a61458e16bcbb7260fe5c172f8d15;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=49-61/
c32c71b519e4b58e1f48ee40921fb5fdfcf8de7f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroSerialization.java
RelaxedAvroSerialization::getSerializer(Class<AvroWrapper<T>> c)
function
@Override public Serializer<AvroWrapper<T>> getSerializer(Class<AvroWrapper<T>> c) { LOG.info("getSerializer for " + c); Schema schema; if (AvroKey.class.isAssignableFrom(c)) { schema = getKeyWriterSchema(getConf()); } else if (AvroValue.class.isAssignableFrom(c)) { schema = getValueWriter...
16,571
03452c16835cc3c78eb65819be26d8a1
swh:1:cnt:b72fa497fe3a61458e16bcbb7260fe5c172f8d15;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=76-79/
c32c71b519e4b58e1f48ee40921fb5fdfcf8de7f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroSerialization.java
RelaxedAvroSerialization::getKeyReaderSchema(Configuration conf)
function
public static Schema getKeyReaderSchema(Configuration conf) { String json = conf.get(CONF_KEY_READER_SCHEMA); return null == json ? null : RelaxedSchemaUtils.parseSchema(json, conf); }
16,572
b15cdaa517f8906a6c8dcfe6ab616b87
swh:1:cnt:b72fa497fe3a61458e16bcbb7260fe5c172f8d15;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=86-89/
c32c71b519e4b58e1f48ee40921fb5fdfcf8de7f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroSerialization.java
RelaxedAvroSerialization::getKeyWriterSchema(Configuration conf)
function
public static Schema getKeyWriterSchema(Configuration conf) { String json = conf.get(CONF_KEY_WRITER_SCHEMA); return null == json ? null : RelaxedSchemaUtils.parseSchema(json, conf); }
16,573
14bb57ccc37bf78bc32000c3ff681985
swh:1:cnt:b72fa497fe3a61458e16bcbb7260fe5c172f8d15;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=91-94/
c32c71b519e4b58e1f48ee40921fb5fdfcf8de7f
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedAvroSerialization.java
RelaxedAvroSerialization::getValueWriterSchema(Configuration conf)
function
public static Schema getValueWriterSchema(Configuration conf) { String json = conf.get(CONF_VALUE_WRITER_SCHEMA); return null == json ? null : RelaxedSchemaUtils.parseSchema(json, conf); }
16,574
b745fff792523f3d474de58170ec35bd
swh:1:cnt:610cfebd4659cd77b934b85c9644380e89fa8ad9;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=10-80/
6aff088d1414f03f6b2bed9b2612153cef07eecd
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedSchemaUtils.java
RelaxedSchemaUtils
type
/** * Class to parse the schema without name validation * * The routines here might try to parse the schema twice. * The first time with name validation on, if it failed with SchemaParseException, * it will try to parse it again without name validation. * * The reason we do this is if the schema was generated/...
16,575
4cf620f5b98dbd9fcfa75df2b1798afd
swh:1:cnt:610cfebd4659cd77b934b85c9644380e89fa8ad9;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=34-41/
6aff088d1414f03f6b2bed9b2612153cef07eecd
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedSchemaUtils.java
RelaxedSchemaUtils::skipNameValidation(Configuration conf)
function
public static boolean skipNameValidation(Configuration conf) { String validateStr = conf.get(CONF_SKIP_NAME_VALIDATION); LOG.info(CONF_SKIP_NAME_VALIDATION + ": " + validateStr); if (validateStr != null && Boolean.parseBoolean(validateStr)) { return true; } return false; }
16,576
8f71f8787a0d14c357cc60c40ed51cc3
swh:1:cnt:610cfebd4659cd77b934b85c9644380e89fa8ad9;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=67-78/
6aff088d1414f03f6b2bed9b2612153cef07eecd
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedSchemaUtils.java
RelaxedSchemaUtils::getInputKeySchema(Configuration conf)
function
/** * Gets the job input key schema. * * This is the equivalent code copied from AvroJob * * @param conf The job configuration. * @return The job input key schema, or null if not set. */ public static Schema getInputKeySchema(Configuration conf) { String schemaString = conf.get(CONF_INPUT_KE...
16,577
cec623873258d135ec79dfb70ad005c9
swh:1:cnt:610cfebd4659cd77b934b85c9644380e89fa8ad9;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=43-65/
6aff088d1414f03f6b2bed9b2612153cef07eecd
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/RelaxedSchemaUtils.java
RelaxedSchemaUtils::parseSchema(String schemaStr, Configuration conf)
function
/** * This routine might try to parse the schema twice. * * @param schemaStr * @return */ public static Schema parseSchema(String schemaStr, Configuration conf) { Schema schema = null; try { schema = new Schema.Parser().parse(schemaStr); } catch (SchemaParseException ex) { bool...
16,578
76c7fc010c728c93712776893849f018
swh:1:cnt:532593c8e9d1583a0867c9601e15b1e2afe40e73;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=12-49/
d355e2bd8fce1a21088701db5010eb52b0762d39
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/Utils.java
Utils
type
public class Utils { /** * Scans the properties to find the keys starting with the provided prefix * Key-Values are returned as a map * * @param props * @param prefix * @return */ public static Map<String, String> getMapByPrefix(Properties props, String prefix) { HashMap<String, String> m...
16,579
251a7cf9539550d99fc574cfa1ca6d25
swh:1:cnt:532593c8e9d1583a0867c9601e15b1e2afe40e73;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=14-31/
d355e2bd8fce1a21088701db5010eb52b0762d39
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/Utils.java
Utils::getMapByPrefix(Properties props, String prefix)
function
/** * Scans the properties to find the keys starting with the provided prefix * Key-Values are returned as a map * * @param props * @param prefix * @return */ public static Map<String, String> getMapByPrefix(Properties props, String prefix) { HashMap<String, String> map = new HashMap<String,...
16,580
dc0a47911fc85c927cce3ac2c32cb876
swh:1:cnt:532593c8e9d1583a0867c9601e15b1e2afe40e73;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=33-47/
d355e2bd8fce1a21088701db5010eb52b0762d39
camus
analytics
camus-sweeper/src/main/java/com/linkedin/camus/sweeper/utils/Utils.java
Utils::getStringList(Properties props, String property)
function
/** * Splits the comma separated value for a key and returns a list containing * those strings * * @param props * @param property * @return null if property doesnt exist, List of Strings otherwise */ public static List<String> getStringList(Properties props, String property) { String value =...
16,581
9056ea0d5c2a234d25f2b1b4015054b3
swh:1:cnt:592f94d67690c055d9a88c147499bd147d270a40;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=22-68/
e38022ba569842b2850878fc53ef64071149fa7a
camus
analytics
camus-sweeper/src/test/java/com/linkedin/camus/sweeper/CamusSingleFolderSweeperPlannerTest.java
CamusSingleFolderSweeperPlannerTest
type
public class CamusSingleFolderSweeperPlannerTest extends EasyMockSupport { @Test public void testCreateSweeperJobProps() throws Exception { FileSystem mockedFs = createMock(FileSystem.class); Path inputDir = new Path("inputDir"); Path outputDir = new Path("outputDir"); DateUtils dUtils = new DateUti...
16,582
1f105cf12f089b1679361636625c23a1
swh:1:cnt:592f94d67690c055d9a88c147499bd147d270a40;origin=https://gerrit.wikimedia.org/r/analytics/camus.git;lines=23-67/
e38022ba569842b2850878fc53ef64071149fa7a
camus
analytics
camus-sweeper/src/test/java/com/linkedin/camus/sweeper/CamusSingleFolderSweeperPlannerTest.java
CamusSingleFolderSweeperPlannerTest::testCreateSweeperJobProps()
function
@Test public void testCreateSweeperJobProps() throws Exception { FileSystem mockedFs = createMock(FileSystem.class); Path inputDir = new Path("inputDir"); Path outputDir = new Path("outputDir"); DateUtils dUtils = new DateUtils(new Properties()); DateTime currentHour = dUtils.getCurrentHour(); ...
16,583
c6f0182b31c2dc81585e1fe2732d77da
swh:1:cnt:e2c9d35fba984d063ed50cd8d617a884f6f49f58;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=36-88/
a8bb3d160680efde33315fd2c80702fc0ace20d2
BetaFeatures
deployed
includes/ApiQueryBetaFeatures.php
ApiQueryBetaFeatures
type
class ApiQueryBetaFeatures extends ApiQueryBase { public function __construct( ApiQuery $query, string $moduleName, private readonly IConnectionProvider $dbProvider, private readonly HookContainer $hookContainer ) { parent::__construct( $query, $moduleName, 'bf' ); } public function execute() { $param...
16,584
24d8999f66e25506c75782ee8c898035
swh:1:cnt:e2c9d35fba984d063ed50cd8d617a884f6f49f58;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=38-45/
a8bb3d160680efde33315fd2c80702fc0ace20d2
BetaFeatures
deployed
includes/ApiQueryBetaFeatures.php
ApiQueryBetaFeatures::__construct( ApiQuery $query, string $moduleName, private readonly IConnectionProvider $dbProvider, private readonly HookContainer $hookContainer )
function
public function __construct( ApiQuery $query, string $moduleName, private readonly IConnectionProvider $dbProvider, private readonly HookContainer $hookContainer ) { parent::__construct( $query, $moduleName, 'bf' ); }
16,585
6108b1466d606381395a564a32ce441f
swh:1:cnt:e2c9d35fba984d063ed50cd8d617a884f6f49f58;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=73-82/
a8bb3d160680efde33315fd2c80702fc0ace20d2
BetaFeatures
deployed
includes/ApiQueryBetaFeatures.php
ApiQueryBetaFeatures::getExamplesMessages()
function
/** * @see ApiBase::getExamplesMessages() * @return array */ protected function getExamplesMessages() { return [ 'action=query&list=betafeatures&bfcounts=' => 'apihelp-query+betafeatures-example-1', ]; }
16,586
05def9323dcdd81fff22a18044e56788
swh:1:cnt:e2c9d35fba984d063ed50cd8d617a884f6f49f58;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=84-87/
a8bb3d160680efde33315fd2c80702fc0ace20d2
BetaFeatures
deployed
includes/ApiQueryBetaFeatures.php
ApiQueryBetaFeatures::getHelpUrls()
function
/** @inheritDoc */ public function getHelpUrls() { return 'https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:BetaFeatures'; }
16,587
ccee703b0ceab0a191cb2d8f4639b2dd
swh:1:cnt:e2c9d35fba984d063ed50cd8d617a884f6f49f58;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=66-71/
a8bb3d160680efde33315fd2c80702fc0ace20d2
BetaFeatures
deployed
includes/ApiQueryBetaFeatures.php
ApiQueryBetaFeatures::getAllowedParams()
function
/** @inheritDoc */ public function getAllowedParams() { return [ 'counts' => null, ]; }
16,588
a8efe8a47562cc34425a69b6b1ea2c08
swh:1:cnt:e2c9d35fba984d063ed50cd8d617a884f6f49f58;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=47-64/
a8bb3d160680efde33315fd2c80702fc0ace20d2
BetaFeatures
deployed
includes/ApiQueryBetaFeatures.php
ApiQueryBetaFeatures::execute()
function
public function execute() { $params = $this->extractRequestParams(); $prefs = $this->getConfig()->get( 'BetaFeatures' ); $user = User::newFromName( 'MediaWiki default' ); ( new HookRunner( $this->hookContainer ) ) ->onGetBetaFeaturePreferences( $user, $prefs ); $counts = isset( $params['counts'] ) ? H...
16,589
89270c97a7c41c9cf0ca9bfbd900c6a2
swh:1:cnt:1f31d0efb6afec7531ca231f15c05247f3a3e937;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=32-62/
0630e76a1deb37ac87c8bf67431c506ea9d5926e
BetaFeatures
deployed
includes/BetaFeatures.php
BetaFeatures
type
class BetaFeatures { /** * Check if a user has a beta feature enabled. * * @param UserIdentity $user The user identity to check * @param string $feature The key passed back to BetaFeatures * from the GetBetaFeaturePreferences hook * @param array|null $userOptions Specific state of user options, * ...
16,590
69e8e5601b5a6b89d3dae9b89abe2072
swh:1:cnt:1f31d0efb6afec7531ca231f15c05247f3a3e937;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=34-61/
0630e76a1deb37ac87c8bf67431c506ea9d5926e
BetaFeatures
deployed
includes/BetaFeatures.php
BetaFeatures::isFeatureEnabled( UserIdentity $user, $feature, $userOptions = null )
function
/** * Check if a user has a beta feature enabled. * * @param UserIdentity $user The user identity to check * @param string $feature The key passed back to BetaFeatures * from the GetBetaFeaturePreferences hook * @param array|null $userOptions Specific state of user options, * can be used to handle...
16,591
da41669b267580a778e4bf6cb7cb4cf4
swh:1:cnt:72f453cf12155a0479b98b16db879c894a55743d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=28-29/
3cec9d6003f8a0479cb9d16ab866aaca41ffac08
BetaFeatures
deployed
includes/BetaFeaturesMissingFieldException.php
BetaFeaturesMissingFieldException
type
class BetaFeaturesMissingFieldException extends Exception { }
16,592
daf4df9f5f5fefa63191260117842be9
swh:1:cnt:723873eb0033e0f5172b4d13f72cf623b3c8b92c;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=54-429/
6888eadbead115c3bd968d581fe335ec55b963e0
BetaFeatures
deployed
includes/Hooks.php
Hooks
type
class Hooks implements ExtensionTypesHook, GetPreferencesHook, MakeGlobalVariablesScriptHook, PreferencesGetIconHook, SaveUserOptionsHook, SkinTemplateNavigation__UniversalHook, UserGetDefaultOptionsHook { /** * @var array An array of each of the available Beta Features, with their requirements, if any. * ...
16,593
5b423fd901f96a38db59472e3e9db2a2
swh:1:cnt:723873eb0033e0f5172b4d13f72cf623b3c8b92c;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=70-81/
6888eadbead115c3bd968d581fe335ec55b963e0
BetaFeatures
deployed
includes/Hooks.php
Hooks::__construct( private readonly Config $config, private readonly IConnectionProvider $dbProvider, private readonly HookContainer $hookContainer, private readonly JobQueueGroupFactory $jobQueueGroupFactory, private readonly SkinFactory $skinFactory, private readonly UserFactory $userFactory, private r...
function
public function __construct( private readonly Config $config, private readonly IConnectionProvider $dbProvider, private readonly HookContainer $hookContainer, private readonly JobQueueGroupFactory $jobQueueGroupFactory, private readonly SkinFactory $skinFactory, private readonly UserFactory $userFactory, ...
16,594
af4b8a0b96a6041057c61a89b6fe37d7
swh:1:cnt:723873eb0033e0f5172b4d13f72cf623b3c8b92c;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=83-106/
6888eadbead115c3bd968d581fe335ec55b963e0
BetaFeatures
deployed
includes/Hooks.php
Hooks::getUserCounts( array $prefs, IConnectionProvider $dbProvider )
function
/** * @param string[] $prefs * @param IConnectionProvider $dbProvider * @return int[] */ public static function getUserCounts( array $prefs, IConnectionProvider $dbProvider ) { $counts = []; if ( !$prefs ) { return $counts; } $dbr = $dbProvider->getReplicaDatabase(); $res = $dbr->newSelectQueryBu...
16,595
9046c6a8aad899f50c9a029a18118962
swh:1:cnt:723873eb0033e0f5172b4d13f72cf623b3c8b92c;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=108-151/
6888eadbead115c3bd968d581fe335ec55b963e0
BetaFeatures
deployed
includes/Hooks.php
Hooks::onSaveUserOptions( UserIdentity $user, array &$modifiedOptions, array $originalOptions )
function
/** * @see https://www.mediawiki.org/wiki/Manual:Hooks/SaveUserOptions * * @param UserIdentity $user User who's just saved their preferences * @param array &$modifiedOptions List of modified options * @param array $originalOptions List of original user options * @throws Exception */ public function onSav...
16,596
e199ca46b0aded094831f6d0291d07d3
swh:1:cnt:723873eb0033e0f5172b4d13f72cf623b3c8b92c;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=362-369/
6888eadbead115c3bd968d581fe335ec55b963e0
BetaFeatures
deployed
includes/Hooks.php
Hooks::onPreferencesGetIcon( &$iconNames )
function
/** * Add icon for Special:Preferences mobile layout * * @param array &$iconNames Array of icon names for their respective sections. */ public function onPreferencesGetIcon( &$iconNames ) { $iconNames[ 'betafeatures' ] = 'labFlask'; }
16,597
f492bf6455e528f7a624197ac707aed2
swh:1:cnt:723873eb0033e0f5172b4d13f72cf623b3c8b92c;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=153-360/
6888eadbead115c3bd968d581fe335ec55b963e0
BetaFeatures
deployed
includes/Hooks.php
Hooks::onGetPreferences( $user, &$prefs )
function
/** * @param User $user * @param array[] &$prefs * @throws BetaFeaturesMissingFieldException */ public function onGetPreferences( $user, &$prefs ) { $betaPrefs = $this->config->get( 'BetaFeatures' ); $depHooks = []; $hookRunner = new HookRunner( $this->hookContainer ); $hookRunner->onGetBetaFeaturePre...
16,598
1f1055d16c65a99b3d9b8b13b9c002d5
swh:1:cnt:723873eb0033e0f5172b4d13f72cf623b3c8b92c;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=371-380/
6888eadbead115c3bd968d581fe335ec55b963e0
BetaFeatures
deployed
includes/Hooks.php
Hooks::onUserGetDefaultOptions( &$defaultOptions )
function
/** * Add default preferences values * * @param array &$defaultOptions Array of preference keys and their default values. */ public function onUserGetDefaultOptions( &$defaultOptions ) { foreach ( $this->config->get( 'BetaFeatures' ) as $key => $info ) { $defaultOptions[$key] = false; } }
16,599
5253c231adb14da3fc84593ffe452379
swh:1:cnt:723873eb0033e0f5172b4d13f72cf623b3c8b92c;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/BetaFeatures.git;lines=382-393/
6888eadbead115c3bd968d581fe335ec55b963e0
BetaFeatures
deployed
includes/Hooks.php
Hooks::onMakeGlobalVariablesScript( &$vars, $out )
function
/** * @param array &$vars * @param OutputPage $out */ public function onMakeGlobalVariablesScript( &$vars, $out ): void { if ( self::$features ) { // This is added to page view HTML on all articles. // FIXME: Move this to the preferences page somehow, or // bundle with the module that loads betafeatur...