Created
October 26, 2018 23:18
-
-
Save nezihyigitbasi/622365e7f9701fa74e22acac1c28fbc4 to your computer and use it in GitHub Desktop.
gen-projection-old.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Source code recreated from a .class file by IntelliJ IDEA | |
// (powered by Fernflower decompiler) | |
// | |
package com.facebook.presto.$gen; | |
import com.facebook.presto.operator.DriverYieldSignal; | |
import com.facebook.presto.operator.Work; | |
import com.facebook.presto.operator.project.SelectedPositions; | |
import com.facebook.presto.spi.ConnectorSession; | |
import com.facebook.presto.spi.Page; | |
import com.facebook.presto.spi.block.Block; | |
import com.facebook.presto.spi.block.BlockBuilder; | |
public final class PageProjectionWork_20181026_231750_1 implements Work { | |
private BlockBuilder blockBuilder; | |
private ConnectorSession session; | |
private DriverYieldSignal yieldSignal; | |
private Page page; | |
private SelectedPositions selectedPositions; | |
private int nextIndexOrPosition; | |
private Block result; | |
public boolean process() { | |
int from = this.nextIndexOrPosition; | |
int to = this.selectedPositions.getOffset() + this.selectedPositions.size(); | |
int index; | |
if (this.selectedPositions.isList()) { | |
int[] positions = this.selectedPositions.getPositions(); | |
for(index = from; index < to; ++index) { | |
this.evaluate(this.session, this.page, positions[index]); | |
if (this.yieldSignal.isSet()) { | |
this.nextIndexOrPosition = index + 1; | |
return false; | |
} | |
} | |
} else { | |
for(index = from; index < to; ++index) { | |
this.evaluate(this.session, this.page, index); | |
if (this.yieldSignal.isSet()) { | |
this.nextIndexOrPosition = index + 1; | |
return false; | |
} | |
} | |
} | |
this.result = this.blockBuilder.build(); | |
return true; | |
} | |
public Object getResult() { | |
return this.result; | |
} | |
public void evaluate(ConnectorSession session, Page page, int position) { | |
Block block_0 = page.getBlock(0); | |
boolean wasNull = false; | |
BlockBuilder var10000 = this.blockBuilder; | |
long var10001; | |
if (block_0.isNull(position)) { | |
wasNull = true; | |
var10001 = 0L; | |
} else { | |
var10001 = bigint<invokedynamic>().getLong(block_0, position); | |
} | |
var10001 = wasNull ? 0L : (wasNull ? 0L : var10001.$operator$ADD<invokedynamic>(var10001, 10L)); | |
if (wasNull) { | |
var10000.appendNull(); | |
} else { | |
long temp_0 = var10001; | |
BlockBuilder temp_2 = var10000; | |
constant_2<invokedynamic>().writeLong(temp_2, temp_0); | |
} | |
} | |
public PageProjectionWork_20181026_231750_1(BlockBuilder blockBuilder, ConnectorSession session, DriverYieldSignal yieldSignal, Page page, SelectedPositions selectedPositions) { | |
this.blockBuilder = blockBuilder; | |
this.session = session; | |
this.yieldSignal = yieldSignal; | |
this.page = page; | |
this.selectedPositions = selectedPositions; | |
this.nextIndexOrPosition = selectedPositions.getOffset(); | |
this.result = null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment