text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.spark.execution;

import com.facebook.airlift.json.Codec;
import com.facebook.airlift.json.JsonCodec;
import com.facebook.airlift.log.Logger;
import com.facebook.airlift.stats.TestingGcMonitor;
import com.facebook.presto.Session;
import com.facebook.presto.common.block.BlockEncodingManager;
import com.facebook.presto.common.io.DataOutput;
import com.facebook.presto.event.SplitMonitor;
import com.facebook.presto.execution.ExecutionFailureInfo;
import com.facebook.presto.execution.ScheduledSplit;
import com.facebook.presto.execution.StageExecutionId;
import com.facebook.presto.execution.StageId;
import com.facebook.presto.execution.TaskId;
import com.facebook.presto.execution.TaskInfo;
import com.facebook.presto.execution.TaskManagerConfig;
import com.facebook.presto.execution.TaskSource;
import com.facebook.presto.execution.TaskState;
import com.facebook.presto.execution.TaskStateMachine;
import com.facebook.presto.execution.TaskStatus;
import com.facebook.presto.execution.buffer.OutputBufferInfo;
import com.facebook.presto.execution.buffer.OutputBufferMemoryManager;
import com.facebook.presto.execution.executor.TaskExecutor;
import com.facebook.presto.memory.MemoryPool;
import com.facebook.presto.memory.NodeMemoryConfig;
import com.facebook.presto.memory.QueryContext;
import com.facebook.presto.memory.VoidTraversingQueryContextVisitor;
import com.facebook.presto.metadata.FunctionAndTypeManager;
import com.facebook.presto.metadata.SessionPropertyManager;
import com.facebook.presto.operator.OperatorContext;
import com.facebook.presto.operator.OutputFactory;
import com.facebook.presto.operator.TaskContext;
import com.facebook.presto.operator.TaskMemoryReservationSummary;
import com.facebook.presto.operator.TaskStats;
import com.facebook.presto.spark.PrestoSparkAuthenticatorProvider;
import com.facebook.presto.spark.PrestoSparkConfig;
import com.facebook.presto.spark.PrestoSparkTaskDescriptor;
import com.facebook.presto.spark.classloader_interface.IPrestoSparkTaskExecutor;
import com.facebook.presto.spark.classloader_interface.IPrestoSparkTaskExecutorFactory;
import com.facebook.presto.spark.classloader_interface.MutablePartitionId;
import com.facebook.presto.spark.classloader_interface.PrestoSparkMutableRow;
import com.facebook.presto.spark.classloader_interface.PrestoSparkSerializedPage;
import com.facebook.presto.spark.classloader_interface.PrestoSparkShuffleStats;
import com.facebook.presto.spark.classloader_interface.PrestoSparkStorageHandle;
import com.facebook.presto.spark.classloader_interface.PrestoSparkTaskInputs;
import com.facebook.presto.spark.classloader_interface.PrestoSparkTaskOutput;
import com.facebook.presto.spark.classloader_interface.SerializedPrestoSparkTaskDescriptor;
import com.facebook.presto.spark.classloader_interface.SerializedPrestoSparkTaskSource;
import com.facebook.presto.spark.classloader_interface.SerializedTaskInfo;
import com.facebook.presto.spark.execution.PrestoSparkPageOutputOperator.PrestoSparkPageOutputFactory;
import com.facebook.presto.spark.execution.PrestoSparkRowBatch.RowTupleSupplier;
import com.facebook.presto.spark.execution.PrestoSparkRowOutputOperator.PreDeterminedPartitionFunction;
import com.facebook.presto.spark.execution.PrestoSparkRowOutputOperator.PrestoSparkRowOutputFactory;
import com.facebook.presto.spi.ConnectorSplit;
import com.facebook.presto.spi.memory.MemoryPoolId;
import com.facebook.presto.spi.page.PageDataOutput;
import com.facebook.presto.spi.plan.PlanNodeId;
import com.facebook.presto.spi.security.TokenAuthenticator;
import com.facebook.presto.spi.storage.TempDataOperationContext;
import com.facebook.presto.spi.storage.TempDataSink;
import com.facebook.presto.spi.storage.TempStorage;
import com.facebook.presto.spi.storage.TempStorageHandle;
import com.facebook.presto.spiller.NodeSpillConfig;
import com.facebook.presto.spiller.SpillSpaceTracker;
import com.facebook.presto.sql.planner.LocalExecutionPlanner;
import com.facebook.presto.sql.planner.LocalExecutionPlanner.LocalExecutionPlan;
import com.facebook.presto.sql.planner.OutputPartitioning;
import com.facebook.presto.sql.planner.PlanFragment;
import com.facebook.presto.sql.planner.plan.PlanFragmentId;
import com.facebook.presto.sql.planner.plan.RemoteSourceNode;
import com.facebook.presto.sql.planner.planPrinter.PlanPrinter;
import com.facebook.presto.storage.TempStorageManager;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import io.airlift.slice.Slice;
import io.airlift.units.DataSize;
import org.apache.spark.broadcast.Broadcast;
import org.apache.spark.util.CollectionAccumulator;
import org.joda.time.DateTime;
import scala.Tuple2;
import scala.collection.AbstractIterator;
import scala.collection.Iterator;

import javax.inject.Inject;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URI;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.OptionalLong;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.zip.CRC32;

import static com.facebook.presto.ExceededMemoryLimitException.exceededLocalTotalMemoryLimit;
import static com.facebook.presto.SystemSessionProperties.getHashPartitionCount;
import static com.facebook.presto.SystemSessionProperties.getHeapDumpFileDirectory;
import static com.facebook.presto.SystemSessionProperties.getQueryMaxBroadcastMemory;
import static com.facebook.presto.SystemSessionProperties.getQueryMaxMemoryPerNode;
import static com.facebook.presto.SystemSessionProperties.getQueryMaxTotalMemoryPerNode;
import static com.facebook.presto.SystemSessionProperties.isHeapDumpOnExceededMemoryLimitEnabled;
import static com.facebook.presto.SystemSessionProperties.isSpillEnabled;
import static com.facebook.presto.SystemSessionProperties.isVerboseExceededMemoryLimitErrorsEnabled;
import static com.facebook.presto.execution.TaskState.FAILED;
import static com.facebook.presto.execution.TaskStatus.STARTING_VERSION;
import static com.facebook.presto.execution.buffer.BufferState.FINISHED;
import static com.facebook.presto.metadata.MetadataUpdates.DEFAULT_METADATA_UPDATES;
import static com.facebook.presto.spark.PrestoSparkSessionProperties.getMemoryRevokingThreshold;
import static com.facebook.presto.spark.PrestoSparkSessionProperties.getShuffleOutputTargetAverageRowSize;
import static com.facebook.presto.spark.PrestoSparkSessionProperties.getSparkBroadcastJoinMaxMemoryOverride;
import static com.facebook.presto.spark.PrestoSparkSessionProperties.getStorageBasedBroadcastJoinWriteBufferSize;
import static com.facebook.presto.spark.classloader_interface.PrestoSparkShuffleStats.Operation.WRITE;
import static com.facebook.presto.spark.util.PrestoSparkUtils.deserializeZstdCompressed;
import static com.facebook.presto.spark.util.PrestoSparkUtils.getNullifyingIterator;
import static com.facebook.presto.spark.util.PrestoSparkUtils.serializeZstdCompressed;
import static com.facebook.presto.spark.util.PrestoSparkUtils.toPrestoSparkSerializedPage;
import static com.facebook.presto.sql.planner.SystemPartitioningHandle.FIXED_ARBITRARY_DISTRIBUTION;
import static com.facebook.presto.util.Failures.toFailures;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.base.Throwables.propagateIfPossible;
import static com.google.common.collect.Iterables.getFirst;
import static io.airlift.units.DataSize.Unit.BYTE;
import static io.airlift.units.DataSize.succinctBytes;
import static java.lang.Math.min;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
import static java.util.UUID.randomUUID;

public class PrestoSparkTaskExecutorFactory
        implements IPrestoSparkTaskExecutorFactory
{
    private static final Logger log = Logger.get(PrestoSparkTaskExecutorFactory.class);

    private final SessionPropertyManager sessionPropertyManager;
    private final BlockEncodingManager blockEncodingManager;
    private final FunctionAndTypeManager functionAndTypeManager;

    private final JsonCodec<PrestoSparkTaskDescriptor> taskDescriptorJsonCodec;
    private final Codec<TaskSource> taskSourceCodec;
    private final Codec<TaskInfo> taskInfoCodec;
    private final JsonCodec<List<TaskMemoryReservationSummary>> memoryReservationSummaryJsonCodec;

    private final Executor notificationExecutor;
    private final ScheduledExecutorService yieldExecutor;
    private final ScheduledExecutorService memoryUpdateExecutor;

    private final LocalExecutionPlanner localExecutionPlanner;
    private final PrestoSparkExecutionExceptionFactory executionExceptionFactory;
    private final TaskExecutor taskExecutor;
    private final SplitMonitor splitMonitor;

    private final Set<PrestoSparkAuthenticatorProvider> authenticatorProviders;

    private final NodeMemoryConfig nodeMemoryConfig;
    private final DataSize maxRevocableMemory;
    private final DataSize maxQuerySpillPerNode;
    private final DataSize sinkMaxBufferSize;

    private final boolean perOperatorCpuTimerEnabled;
    private final boolean cpuTimerEnabled;

    private final boolean perOperatorAllocationTrackingEnabled;
    private final boolean allocationTrackingEnabled;
    private final TempStorageManager tempStorageManager;
    private final PrestoSparkBroadcastTableCacheManager prestoSparkBroadcastTableCacheManager;
    private final String storageBasedBroadcastJoinStorage;

    private AtomicBoolean memoryRevokePending = new AtomicBoolean();

    @Inject
    public PrestoSparkTaskExecutorFactory(
            SessionPropertyManager sessionPropertyManager,
            BlockEncodingManager blockEncodingManager,
            FunctionAndTypeManager functionAndTypeManager,
            JsonCodec<PrestoSparkTaskDescriptor> taskDescriptorJsonCodec,
            Codec<TaskSource> taskSourceCodec,
            Codec<TaskInfo> taskInfoCodec,
            JsonCodec<List<TaskMemoryReservationSummary>> memoryReservationSummaryJsonCodec,
            Executor notificationExecutor,
            ScheduledExecutorService yieldExecutor,
            ScheduledExecutorService memoryUpdateExecutor,
            LocalExecutionPlanner localExecutionPlanner,
            PrestoSparkExecutionExceptionFactory executionExceptionFactory,
            TaskExecutor taskExecutor,
            SplitMonitor splitMonitor,
            Set<PrestoSparkAuthenticatorProvider> authenticatorProviders,
            TaskManagerConfig taskManagerConfig,
            NodeMemoryConfig nodeMemoryConfig,
            NodeSpillConfig nodeSpillConfig,
            TempStorageManager tempStorageManager,
            PrestoSparkBroadcastTableCacheManager prestoSparkBroadcastTableCacheManager,
            PrestoSparkConfig prestoSparkConfig)
    {
        this(
                sessionPropertyManager,
                blockEncodingManager,
                functionAndTypeManager,
                taskDescriptorJsonCodec,
                taskSourceCodec,
                taskInfoCodec,
                memoryReservationSummaryJsonCodec,
                notificationExecutor,
                yieldExecutor,
                memoryUpdateExecutor,
                localExecutionPlanner,
                executionExceptionFactory,
                taskExecutor,
                splitMonitor,
                authenticatorProviders,
                nodeMemoryConfig,
                requireNonNull(nodeSpillConfig, "nodeSpillConfig is null").getMaxRevocableMemoryPerNode(),
                requireNonNull(nodeSpillConfig, "nodeSpillConfig is null").getQueryMaxSpillPerNode(),
                requireNonNull(taskManagerConfig, "taskManagerConfig is null").getSinkMaxBufferSize(),
                requireNonNull(taskManagerConfig, "taskManagerConfig is null").isPerOperatorCpuTimerEnabled(),
                requireNonNull(taskManagerConfig, "taskManagerConfig is null").isTaskCpuTimerEnabled(),
                requireNonNull(taskManagerConfig, "taskManagerConfig is null").isPerOperatorAllocationTrackingEnabled(),
                requireNonNull(taskManagerConfig, "taskManagerConfig is null").isTaskAllocationTrackingEnabled(),
                tempStorageManager,
                requireNonNull(prestoSparkConfig, "prestoSparkConfig is null").getStorageBasedBroadcastJoinStorage(),
                prestoSparkBroadcastTableCacheManager);
    }

    public PrestoSparkTaskExecutorFactory(
            SessionPropertyManager sessionPropertyManager,
            BlockEncodingManager blockEncodingManager,
            FunctionAndTypeManager functionAndTypeManager,
            JsonCodec<PrestoSparkTaskDescriptor> taskDescriptorJsonCodec,
            Codec<TaskSource> taskSourceCodec,
            Codec<TaskInfo> taskInfoCodec,
            JsonCodec<List<TaskMemoryReservationSummary>> memoryReservationSummaryJsonCodec,
            Executor notificationExecutor,
            ScheduledExecutorService yieldExecutor,
            ScheduledExecutorService memoryUpdateExecutor,
            LocalExecutionPlanner localExecutionPlanner,
            PrestoSparkExecutionExceptionFactory executionExceptionFactory,
            TaskExecutor taskExecutor,
            SplitMonitor splitMonitor,
            Set<PrestoSparkAuthenticatorProvider> authenticatorProviders,
            NodeMemoryConfig nodeMemoryConfig,
            DataSize maxRevocableMemory,
            DataSize maxQuerySpillPerNode,
            DataSize sinkMaxBufferSize,
            boolean perOperatorCpuTimerEnabled,
            boolean cpuTimerEnabled,
            boolean perOperatorAllocationTrackingEnabled,
            boolean allocationTrackingEnabled,
            TempStorageManager tempStorageManager,
            String storageBasedBroadcastJoinStorage,
            PrestoSparkBroadcastTableCacheManager prestoSparkBroadcastTableCacheManager)
    {
        this.sessionPropertyManager = requireNonNull(sessionPropertyManager, "sessionPropertyManager is null");
        this.blockEncodingManager = requireNonNull(blockEncodingManager, "blockEncodingManager is null");
        this.functionAndTypeManager = requireNonNull(functionAndTypeManager, "functionManager is null");
        this.taskDescriptorJsonCodec = requireNonNull(taskDescriptorJsonCodec, "sparkTaskDescriptorJsonCodec is null");
        this.taskSourceCodec = requireNonNull(taskSourceCodec, "taskSourceCodec is null");
        this.taskInfoCodec = requireNonNull(taskInfoCodec, "taskInfoCodec is null");
        this.memoryReservationSummaryJsonCodec = requireNonNull(memoryReservationSummaryJsonCodec, "memoryReservationSummaryJsonCodec is null");
        this.notificationExecutor = requireNonNull(notificationExecutor, "notificationExecutor is null");
        this.yieldExecutor = requireNonNull(yieldExecutor, "yieldExecutor is null");
        this.memoryUpdateExecutor = requireNonNull(memoryUpdateExecutor, "memoryUpdateExecutor is null");
        this.localExecutionPlanner = requireNonNull(localExecutionPlanner, "localExecutionPlanner is null");
        this.executionExceptionFactory = requireNonNull(executionExceptionFactory, "executionExceptionFactory is null");
        this.taskExecutor = requireNonNull(taskExecutor, "taskExecutor is null");
        this.splitMonitor = requireNonNull(splitMonitor, "splitMonitor is null");
        this.authenticatorProviders = ImmutableSet.copyOf(requireNonNull(authenticatorProviders, "authenticatorProviders is null"));
        // Ordering is needed to make sure serialized plans are consistent for the same map
        this.nodeMemoryConfig = requireNonNull(nodeMemoryConfig, "nodeMemoryConfig is null");
        this.maxRevocableMemory = requireNonNull(maxRevocableMemory, "maxRevocableMemory is null");
        this.maxQuerySpillPerNode = requireNonNull(maxQuerySpillPerNode, "maxQuerySpillPerNode is null");
        this.sinkMaxBufferSize = requireNonNull(sinkMaxBufferSize, "sinkMaxBufferSize is null");
        this.perOperatorCpuTimerEnabled = perOperatorCpuTimerEnabled;
        this.cpuTimerEnabled = cpuTimerEnabled;
        this.perOperatorAllocationTrackingEnabled = perOperatorAllocationTrackingEnabled;
        this.allocationTrackingEnabled = allocationTrackingEnabled;
        this.tempStorageManager = requireNonNull(tempStorageManager, "tempStorageManager is null");
        this.storageBasedBroadcastJoinStorage = requireNonNull(storageBasedBroadcastJoinStorage, "storageBasedBroadcastJoinStorage is null");
        this.prestoSparkBroadcastTableCacheManager = requireNonNull(prestoSparkBroadcastTableCacheManager, "prestoSparkBroadcastTableCacheManager is null");
    }

    @Override
    public <T extends PrestoSparkTaskOutput> IPrestoSparkTaskExecutor<T> create(
            int partitionId,
            int attemptNumber,
            SerializedPrestoSparkTaskDescriptor serializedTaskDescriptor,
            Iterator<SerializedPrestoSparkTaskSource> serializedTaskSources,
            PrestoSparkTaskInputs inputs,
            CollectionAccumulator<SerializedTaskInfo> taskInfoCollector,
            CollectionAccumulator<PrestoSparkShuffleStats> shuffleStatsCollector,
            Class<T> outputType)
    {
        try {
            return doCreate(
                    partitionId,
                    attemptNumber,
                    serializedTaskDescriptor,
                    serializedTaskSources,
                    inputs,
                    taskInfoCollector,
                    shuffleStatsCollector,
                    outputType);
        }
        catch (RuntimeException e) {
            throw executionExceptionFactory.toPrestoSparkExecutionException(e);
        }
    }

    public <T extends PrestoSparkTaskOutput> IPrestoSparkTaskExecutor<T> doCreate(
            int partitionId,
            int attemptNumber,
            SerializedPrestoSparkTaskDescriptor serializedTaskDescriptor,
            Iterator<SerializedPrestoSparkTaskSource> serializedTaskSources,
            PrestoSparkTaskInputs inputs,
            CollectionAccumulator<SerializedTaskInfo> taskInfoCollector,
            CollectionAccumulator<PrestoSparkShuffleStats> shuffleStatsCollector,
            Class<T> outputType)
    {
        PrestoSparkTaskDescriptor taskDescriptor = taskDescriptorJsonCodec.fromJson(serializedTaskDescriptor.getBytes());
        ImmutableMap.Builder<String, TokenAuthenticator> extraAuthenticators = ImmutableMap.builder();
        authenticatorProviders.forEach(provider -> extraAuthenticators.putAll(provider.getTokenAuthenticators()));

        Session session = taskDescriptor.getSession().toSession(
                sessionPropertyManager,
                taskDescriptor.getExtraCredentials(),
                extraAuthenticators.build());
        PlanFragment fragment = taskDescriptor.getFragment();
        StageId stageId = new StageId(session.getQueryId(), fragment.getId().getId());

        // Clear the cache if the cache does not have broadcast table for current stageId.
        // We will only cache 1 HT at any time. If the stageId changes, we will drop the old cached HT
        prestoSparkBroadcastTableCacheManager.removeCachedTablesForStagesOtherThan(stageId);

        // TODO: include attemptId in taskId
        TaskId taskId = new TaskId(new StageExecutionId(stageId, 0), partitionId);

        List<TaskSource> taskSources = getTaskSources(serializedTaskSources);

        log.info("Task [%s] received %d splits.",
                taskId,
                taskSources.stream()
                        .mapToInt(taskSource -> taskSource.getSplits().size())
                        .sum());

        OptionalLong totalSplitSize = computeAllSplitsSize(taskSources);
        if (totalSplitSize.isPresent()) {
            log.info("Total split size: %s bytes.", totalSplitSize.getAsLong());
        }

        // TODO: Remove this once we can display the plan on Spark UI.

        log.info(PlanPrinter.textPlanFragment(fragment, functionAndTypeManager, session, true));

        DataSize maxUserMemory = new DataSize(min(nodeMemoryConfig.getMaxQueryMemoryPerNode().toBytes(), getQueryMaxMemoryPerNode(session).toBytes()), BYTE);
        DataSize maxTotalMemory = new DataSize(min(nodeMemoryConfig.getMaxQueryTotalMemoryPerNode().toBytes(), getQueryMaxTotalMemoryPerNode(session).toBytes()), BYTE);
        DataSize maxBroadcastMemory = getSparkBroadcastJoinMaxMemoryOverride(session);
        if (maxBroadcastMemory == null) {
            maxBroadcastMemory = new DataSize(min(nodeMemoryConfig.getMaxQueryBroadcastMemory().toBytes(), getQueryMaxBroadcastMemory(session).toBytes()), BYTE);
        }

        MemoryPool memoryPool = new MemoryPool(new MemoryPoolId("spark-executor-memory-pool"), maxTotalMemory);

        SpillSpaceTracker spillSpaceTracker = new SpillSpaceTracker(maxQuerySpillPerNode);

        QueryContext queryContext = new QueryContext(
                session.getQueryId(),
                maxUserMemory,
                maxTotalMemory,
                maxBroadcastMemory,
                maxRevocableMemory,
                memoryPool,
                new TestingGcMonitor(),
                notificationExecutor,
                yieldExecutor,
                maxQuerySpillPerNode,
                spillSpaceTracker,
                memoryReservationSummaryJsonCodec);
        queryContext.setVerboseExceededMemoryLimitErrorsEnabled(isVerboseExceededMemoryLimitErrorsEnabled(session));
        queryContext.setHeapDumpOnExceededMemoryLimitEnabled(isHeapDumpOnExceededMemoryLimitEnabled(session));
        String heapDumpFilePath = Paths.get(
                getHeapDumpFileDirectory(session),
                format("%s_%s.hprof", session.getQueryId().getId(), stageId.getId())).toString();
        queryContext.setHeapDumpFilePath(heapDumpFilePath);

        TaskStateMachine taskStateMachine = new TaskStateMachine(taskId, notificationExecutor);
        TaskContext taskContext = queryContext.addTaskContext(
                taskStateMachine,
                session,
                // Plan has to be retained only if verbose memory exceeded errors are requested
                isVerboseExceededMemoryLimitErrorsEnabled(session) ? Optional.of(fragment.getRoot()) : Optional.empty(),
                perOperatorCpuTimerEnabled,
                cpuTimerEnabled,
                perOperatorAllocationTrackingEnabled,
                allocationTrackingEnabled,
                false);

        final double memoryRevokingThreshold = getMemoryRevokingThreshold(session);
        if (isSpillEnabled(session)) {
            memoryPool.addListener((pool, queryId, totalMemoryReservationBytes) -> {
                if (totalMemoryReservationBytes > queryContext.getPeakNodeTotalMemory()) {
                    queryContext.setPeakNodeTotalMemory(totalMemoryReservationBytes);
                }
                if (totalMemoryReservationBytes > maxTotalMemory.toBytes()) {
                    throw exceededLocalTotalMemoryLimit(
                            maxTotalMemory,
                            queryContext.getAdditionalFailureInfo(totalMemoryReservationBytes, 0) +
                                    format("Total reserved memory: %s, Total revocable memory: %s",
                                            succinctBytes(pool.getQueryMemoryReservation(queryId)),
                                            succinctBytes(pool.getQueryRevocableMemoryReservation(queryId))),
                            isHeapDumpOnExceededMemoryLimitEnabled(session),
                            Optional.ofNullable(heapDumpFilePath));
                }
                if (totalMemoryReservationBytes > pool.getMaxBytes() * memoryRevokingThreshold && memoryRevokePending.compareAndSet(false, true)) {
                    memoryUpdateExecutor.execute(() -> {
                        try {
                            taskContext.accept(new VoidTraversingQueryContextVisitor<Void>()
                            {
                                @Override
                                public Void visitOperatorContext(OperatorContext operatorContext, Void nothing)
                                {
                                    operatorContext.requestMemoryRevoking();
                                    return null;
                                }
                            }, null);
                            memoryRevokePending.set(false);
                        }
                        catch (Exception e) {
                            log.error(e, "Error requesting memory revoking");
                        }
                    });
                }
            });
        }

        ImmutableMap.Builder<PlanNodeId, List<PrestoSparkShuffleInput>> shuffleInputs = ImmutableMap.builder();
        ImmutableMap.Builder<PlanNodeId, List<java.util.Iterator<PrestoSparkSerializedPage>>> pageInputs = ImmutableMap.builder();
        ImmutableMap.Builder<PlanNodeId, List<?>> broadcastInputs = ImmutableMap.builder();
        for (RemoteSourceNode remoteSource : fragment.getRemoteSourceNodes()) {
            List<PrestoSparkShuffleInput> remoteSourceRowInputs = new ArrayList<>();
            List<java.util.Iterator<PrestoSparkSerializedPage>> remoteSourcePageInputs = new ArrayList<>();
            List<List<?>> broadcastInputsList = new ArrayList<>();
            for (PlanFragmentId sourceFragmentId : remoteSource.getSourceFragmentIds()) {
                Iterator<Tuple2<MutablePartitionId, PrestoSparkMutableRow>> shuffleInput = inputs.getShuffleInputs().get(sourceFragmentId.toString());
                Broadcast<?> broadcastInput = inputs.getBroadcastInputs().get(sourceFragmentId.toString());
                List<PrestoSparkSerializedPage> inMemoryInput = inputs.getInMemoryInputs().get(sourceFragmentId.toString());

                if (shuffleInput != null) {
                    checkArgument(broadcastInput == null, "single remote source is not expected to accept different kind of inputs");
                    checkArgument(inMemoryInput == null, "single remote source is not expected to accept different kind of inputs");
                    remoteSourceRowInputs.add(new PrestoSparkShuffleInput(sourceFragmentId.getId(), shuffleInput));
                    continue;
                }

                if (broadcastInput != null) {
                    checkArgument(inMemoryInput == null, "single remote source is not expected to accept different kind of inputs");
                    // TODO: Enable NullifyingIterator once migrated to one task per JVM model
                    // NullifyingIterator removes element from the list upon return
                    // This allows GC to gradually reclaim memory
                    // remoteSourcePageInputs.add(getNullifyingIterator(broadcastInput.value()));
                    broadcastInputsList.add((List<?>) broadcastInput.value());
                    continue;
                }

                if (inMemoryInput != null) {
                    // for inmemory inputs pages can be released incrementally to save memory
                    remoteSourcePageInputs.add(getNullifyingIterator(inMemoryInput));
                    continue;
                }

                throw new IllegalArgumentException("Input not found for sourceFragmentId: " + sourceFragmentId);
            }
            if (!remoteSourceRowInputs.isEmpty()) {
                shuffleInputs.put(remoteSource.getId(), remoteSourceRowInputs);
            }
            if (!remoteSourcePageInputs.isEmpty()) {
                pageInputs.put(remoteSource.getId(), remoteSourcePageInputs);
            }
            if (!broadcastInputsList.isEmpty()) {
                broadcastInputs.put(remoteSource.getId(), broadcastInputsList);
            }
        }

        OutputBufferMemoryManager memoryManager = new OutputBufferMemoryManager(
                sinkMaxBufferSize.toBytes(),
                () -> queryContext.getTaskContextByTaskId(taskId).localSystemMemoryContext(),
                notificationExecutor);

        Optional<OutputPartitioning> preDeterminedPartition = Optional.empty();
        if (fragment.getPartitioningScheme().getPartitioning().getHandle().equals(FIXED_ARBITRARY_DISTRIBUTION)) {
            int partitionCount = getHashPartitionCount(session);
            preDeterminedPartition = Optional.of(new OutputPartitioning(
                    new PreDeterminedPartitionFunction(partitionId % partitionCount, partitionCount),
                    ImmutableList.of(),
                    ImmutableList.of(),
                    false,
                    OptionalInt.empty()));
        }

        TempDataOperationContext tempDataOperationContext = new TempDataOperationContext(
                session.getSource(),
                session.getQueryId().getId(),
                session.getClientInfo(),
                Optional.of(session.getClientTags()),
                session.getIdentity());
        TempStorage tempStorage = tempStorageManager.getTempStorage(storageBasedBroadcastJoinStorage);

        Output<T> output = configureOutput(
                outputType,
                blockEncodingManager,
                memoryManager,
                getShuffleOutputTargetAverageRowSize(session),
                preDeterminedPartition,
                tempStorage,
                tempDataOperationContext,
                getStorageBasedBroadcastJoinWriteBufferSize(session));
        PrestoSparkOutputBuffer<?> outputBuffer = output.getOutputBuffer();

        LocalExecutionPlan localExecutionPlan = localExecutionPlanner.plan(
                taskContext,
                fragment.getRoot(),
                fragment.getPartitioningScheme(),
                fragment.getStageExecutionDescriptor(),
                fragment.getTableScanSchedulingOrder(),
                output.getOutputFactory(),
                new PrestoSparkRemoteSourceFactory(
                        blockEncodingManager,
                        shuffleInputs.build(),
                        pageInputs.build(),
                        broadcastInputs.build(),
                        partitionId,
                        shuffleStatsCollector,
                        tempStorage,
                        tempDataOperationContext,
                        prestoSparkBroadcastTableCacheManager,
                        stageId),
                taskDescriptor.getTableWriteInfo(),
                true);

        taskStateMachine.addStateChangeListener(state -> {
            if (state.isDone()) {
                outputBuffer.setNoMoreRows();
            }
        });

        PrestoSparkTaskExecution taskExecution = new PrestoSparkTaskExecution(
                taskStateMachine,
                taskContext,
                localExecutionPlan,
                taskExecutor,
                splitMonitor,
                notificationExecutor,
                memoryUpdateExecutor);

        taskExecution.start(taskSources);

        return new PrestoSparkTaskExecutor<>(
                taskContext,
                taskStateMachine,
                output.getOutputSupplier(),
                taskInfoCodec,
                taskInfoCollector,
                shuffleStatsCollector,
                executionExceptionFactory,
                output.getOutputBufferType(),
                outputBuffer,
                tempStorage,
                tempDataOperationContext);
    }

    private static OptionalLong computeAllSplitsSize(List<TaskSource> taskSources)
    {
        long sum = 0;
        for (TaskSource taskSource : taskSources) {
            for (ScheduledSplit scheduledSplit : taskSource.getSplits()) {
                ConnectorSplit connectorSplit = scheduledSplit.getSplit().getConnectorSplit();
                if (!connectorSplit.getSplitSizeInBytes().isPresent()) {
                    return OptionalLong.empty();
                }

                sum += connectorSplit.getSplitSizeInBytes().getAsLong();
            }
        }

        return OptionalLong.of(sum);
    }

    private List<TaskSource> getTaskSources(Iterator<SerializedPrestoSparkTaskSource> serializedTaskSources)
    {
        long totalSerializedSizeInBytes = 0;
        ImmutableList.Builder<TaskSource> result = ImmutableList.builder();
        while (serializedTaskSources.hasNext()) {
            SerializedPrestoSparkTaskSource serializedTaskSource = serializedTaskSources.next();
            totalSerializedSizeInBytes += serializedTaskSource.getBytes().length;
            result.add(deserializeZstdCompressed(taskSourceCodec, serializedTaskSource.getBytes()));
        }
        log.info("Total serialized size of all task sources: %s", succinctBytes(totalSerializedSizeInBytes));
        return result.build();
    }

    @SuppressWarnings("unchecked")
    private static <T extends PrestoSparkTaskOutput> Output<T> configureOutput(
            Class<T> outputType,
            BlockEncodingManager blockEncodingManager,
            OutputBufferMemoryManager memoryManager,
            DataSize targetAverageRowSize,
            Optional<OutputPartitioning> preDeterminedPartition,
            TempStorage tempStorage,
            TempDataOperationContext tempDataOperationContext,
            DataSize writeBufferSize)
    {
        if (outputType.equals(PrestoSparkMutableRow.class)) {
            PrestoSparkOutputBuffer<PrestoSparkRowBatch> outputBuffer = new PrestoSparkOutputBuffer<>(memoryManager);
            OutputFactory outputFactory = new PrestoSparkRowOutputFactory(outputBuffer, targetAverageRowSize, preDeterminedPartition);
            OutputSupplier<T> outputSupplier = (OutputSupplier<T>) new RowOutputSupplier(outputBuffer);
            return new Output<>(OutputBufferType.SPARK_ROW_OUTPUT_BUFFER, outputBuffer, outputFactory, outputSupplier);
        }
        else if (outputType.equals(PrestoSparkSerializedPage.class)) {
            PrestoSparkOutputBuffer<PrestoSparkBufferedSerializedPage> outputBuffer = new PrestoSparkOutputBuffer<>(memoryManager);
            OutputFactory outputFactory = new PrestoSparkPageOutputFactory(outputBuffer, blockEncodingManager);
            OutputSupplier<T> outputSupplier = (OutputSupplier<T>) new PageOutputSupplier(outputBuffer);
            return new Output<>(OutputBufferType.SPARK_PAGE_OUTPUT_BUFFER, outputBuffer, outputFactory, outputSupplier);
        }
        else if (outputType.equals(PrestoSparkStorageHandle.class)) {
            PrestoSparkOutputBuffer<PrestoSparkBufferedSerializedPage> outputBuffer = new PrestoSparkOutputBuffer<>(memoryManager);
            OutputFactory outputFactory = new PrestoSparkPageOutputFactory(outputBuffer, blockEncodingManager);
            OutputSupplier<T> outputSupplier = (OutputSupplier<T>) new DiskPageOutputSupplier(outputBuffer, tempStorage, tempDataOperationContext, writeBufferSize);
            return new Output<>(OutputBufferType.SPARK_DISK_PAGE_OUTPUT_BUFFER, outputBuffer, outputFactory, outputSupplier);
        }
        else {
            throw new IllegalArgumentException("Unexpected output type: " + outputType.getName());
        }
    }

    private static class PrestoSparkTaskExecutor<T extends PrestoSparkTaskOutput>
            extends AbstractIterator<Tuple2<MutablePartitionId, T>>
            implements IPrestoSparkTaskExecutor<T>
    {
        private final TaskContext taskContext;
        private final TaskStateMachine taskStateMachine;
        private final OutputSupplier<T> outputSupplier;
        private final Codec<TaskInfo> taskInfoCodec;
        private final CollectionAccumulator<SerializedTaskInfo> taskInfoCollector;
        private final CollectionAccumulator<PrestoSparkShuffleStats> shuffleStatsCollector;
        private final PrestoSparkExecutionExceptionFactory executionExceptionFactory;
        private final OutputBufferType outputBufferType;
        private final PrestoSparkOutputBuffer<?> outputBuffer;
        private final TempStorage tempStorage;
        private final TempDataOperationContext tempDataOperationContext;

        private final UUID taskInstanceId = randomUUID();

        private Tuple2<MutablePartitionId, T> next;

        private Long start;
        private long processedRows;
        private long processedRowBatches;
        private long processedBytes;

        private PrestoSparkTaskExecutor(
                TaskContext taskContext,
                TaskStateMachine taskStateMachine,
                OutputSupplier<T> outputSupplier,
                Codec<TaskInfo> taskInfoCodec,
                CollectionAccumulator<SerializedTaskInfo> taskInfoCollector,
                CollectionAccumulator<PrestoSparkShuffleStats> shuffleStatsCollector,
                PrestoSparkExecutionExceptionFactory executionExceptionFactory,
                OutputBufferType outputBufferType,
                PrestoSparkOutputBuffer<?> outputBuffer,
                TempStorage tempStorage,
                TempDataOperationContext tempDataOperationContext)
        {
            this.taskContext = requireNonNull(taskContext, "taskContext is null");
            this.taskStateMachine = requireNonNull(taskStateMachine, "taskStateMachine is null");
            this.outputSupplier = requireNonNull(outputSupplier, "outputSupplier is null");
            this.taskInfoCodec = requireNonNull(taskInfoCodec, "taskInfoCodec is null");
            this.taskInfoCollector = requireNonNull(taskInfoCollector, "taskInfoCollector is null");
            this.shuffleStatsCollector = requireNonNull(shuffleStatsCollector, "shuffleStatsCollector is null");
            this.executionExceptionFactory = requireNonNull(executionExceptionFactory, "executionExceptionFactory is null");
            this.outputBufferType = requireNonNull(outputBufferType, "outputBufferType is null");
            this.outputBuffer = requireNonNull(outputBuffer, "outputBuffer is null");
            this.tempStorage = requireNonNull(tempStorage, "tempStorage is null");
            this.tempDataOperationContext = requireNonNull(tempDataOperationContext, "tempDataOperationContext is null");
        }

        @Override
        public boolean hasNext()
        {
            if (next == null) {
                next = computeNext();
            }
            return next != null;
        }

        @Override
        public Tuple2<MutablePartitionId, T> next()
        {
            if (next == null) {
                next = computeNext();
            }
            if (next == null) {
                throw new NoSuchElementException();
            }
            Tuple2<MutablePartitionId, T> result = next;
            next = null;
            return result;
        }

        protected Tuple2<MutablePartitionId, T> computeNext()
        {
            try {
                return doComputeNext();
            }
            catch (RuntimeException e) {
                throw executionExceptionFactory.toPrestoSparkExecutionException(e);
            }
            catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                taskStateMachine.abort();
                throw new RuntimeException(e);
            }
        }

        private Tuple2<MutablePartitionId, T> doComputeNext()
                throws InterruptedException
        {
            if (start == null) {
                start = System.currentTimeMillis();
            }
            Tuple2<MutablePartitionId, T> output = outputSupplier.getNext();

            if (output != null) {
                processedRows += output._2.getPositionCount();
                processedRowBatches++;
                processedBytes += output._2.getSize();
                return output;
            }

            // task finished
            TaskState taskState = taskStateMachine.getState();
            checkState(taskState.isDone(), "task is expected to be done");

            long end = System.currentTimeMillis();
            PrestoSparkShuffleStats shuffleStats = new PrestoSparkShuffleStats(
                    taskContext.getTaskId().getStageExecutionId().getStageId().getId(),
                    taskContext.getTaskId().getId(),
                    WRITE,
                    processedRows,
                    processedRowBatches,
                    processedBytes,
                    end - start - outputSupplier.getTimeSpentWaitingForOutputInMillis());
            shuffleStatsCollector.add(shuffleStats);

            TaskInfo taskInfo = createTaskInfo(taskContext, taskStateMachine, taskInstanceId, outputBufferType, outputBuffer);
            SerializedTaskInfo serializedTaskInfo = new SerializedTaskInfo(serializeZstdCompressed(taskInfoCodec, taskInfo));
            taskInfoCollector.add(serializedTaskInfo);

            LinkedBlockingQueue<Throwable> failures = taskStateMachine.getFailureCauses();
            if (failures.isEmpty()) {
                return null;
            }

            Throwable failure = getFirst(failures, null);
            // Delete the storage file, if task is not successful
            if (outputSupplier instanceof DiskPageOutputSupplier && output != null) {
                PrestoSparkStorageHandle sparkStorageHandle = (PrestoSparkStorageHandle) output._2;
                TempStorageHandle tempStorageHandle = tempStorage.deserialize(sparkStorageHandle.getSerializedStorageHandle());
                try {
                    tempStorage.remove(tempDataOperationContext, tempStorageHandle);
                    log.info("Removed broadcast spill file: " + tempStorageHandle.toString());
                }
                catch (IOException e) {
                    // self suppression is not allowed
                    if (e != failure) {
                        failure.addSuppressed(e);
                    }
                }
            }

            propagateIfPossible(failure, Error.class);
            propagateIfPossible(failure, RuntimeException.class);
            propagateIfPossible(failure, InterruptedException.class);
            throw new RuntimeException(failure);
        }

        private static TaskInfo createTaskInfo(
                TaskContext taskContext,
                TaskStateMachine taskStateMachine,
                UUID taskInstanceId,
                OutputBufferType outputBufferType,
                PrestoSparkOutputBuffer<?> outputBuffer)
        {
            TaskId taskId = taskContext.getTaskId();
            TaskState taskState = taskContext.getState();
            TaskStats taskStats = taskContext.getTaskStats().summarizeFinal();

            List<ExecutionFailureInfo> failures = ImmutableList.of();
            if (taskState == FAILED) {
                failures = toFailures(taskStateMachine.getFailureCauses());
            }

            TaskStatus taskStatus = new TaskStatus(
                    taskInstanceId.getLeastSignificantBits(),
                    taskInstanceId.getMostSignificantBits(),
                    STARTING_VERSION,
                    taskState,
                    URI.create("http://fake.invalid/task/" + taskId),
                    taskContext.getCompletedDriverGroups(),
                    failures,
                    taskStats.getQueuedPartitionedDrivers(),
                    taskStats.getRunningPartitionedDrivers(),
                    0,
                    false,
                    taskStats.getPhysicalWrittenDataSizeInBytes(),
                    taskStats.getUserMemoryReservationInBytes(),
                    taskStats.getSystemMemoryReservationInBytes(),
                    taskStats.getPeakNodeTotalMemoryInBytes(),
                    taskStats.getFullGcCount(),
                    taskStats.getFullGcTimeInMillis(),
                    taskStats.getTotalCpuTimeInNanos(),
                    System.currentTimeMillis() - taskStats.getCreateTime().getMillis());

            OutputBufferInfo outputBufferInfo = new OutputBufferInfo(
                    outputBufferType.name(),
                    FINISHED,
                    false,
                    false,
                    0,
                    0,
                    outputBuffer.getTotalRowsProcessed(),
                    outputBuffer.getTotalPagesProcessed(),
                    ImmutableList.of());

            return new TaskInfo(
                    taskId,
                    taskStatus,
                    DateTime.now(),
                    outputBufferInfo,
                    ImmutableSet.of(),
                    taskStats,
                    false,
                    DEFAULT_METADATA_UPDATES,
                    "");
        }
    }

    private static class Output<T extends PrestoSparkTaskOutput>
    {
        private final OutputBufferType outputBufferType;
        private final PrestoSparkOutputBuffer<?> outputBuffer;
        private final OutputFactory outputFactory;
        private final OutputSupplier<T> outputSupplier;

        private Output(
                OutputBufferType outputBufferType,
                PrestoSparkOutputBuffer<?> outputBuffer,
                OutputFactory outputFactory,
                OutputSupplier<T> outputSupplier)
        {
            this.outputBufferType = requireNonNull(outputBufferType, "outputBufferType is null");
            this.outputBuffer = requireNonNull(outputBuffer, "outputBuffer is null");
            this.outputFactory = requireNonNull(outputFactory, "outputFactory is null");
            this.outputSupplier = requireNonNull(outputSupplier, "outputSupplier is null");
        }

        public OutputBufferType getOutputBufferType()
        {
            return outputBufferType;
        }

        public PrestoSparkOutputBuffer<?> getOutputBuffer()
        {
            return outputBuffer;
        }

        public OutputFactory getOutputFactory()
        {
            return outputFactory;
        }

        public OutputSupplier<T> getOutputSupplier()
        {
            return outputSupplier;
        }
    }

    private interface OutputSupplier<T extends PrestoSparkTaskOutput>
    {
        Tuple2<MutablePartitionId, T> getNext()
                throws InterruptedException;

        long getTimeSpentWaitingForOutputInMillis();
    }

    private static class RowOutputSupplier
            implements OutputSupplier<PrestoSparkMutableRow>
    {
        private final PrestoSparkOutputBuffer<PrestoSparkRowBatch> outputBuffer;
        private RowTupleSupplier currentRowTupleSupplier;

        private long timeSpentWaitingForOutputInMillis;

        private RowOutputSupplier(PrestoSparkOutputBuffer<PrestoSparkRowBatch> outputBuffer)
        {
            this.outputBuffer = requireNonNull(outputBuffer, "outputBuffer is null");
        }

        @Override
        public Tuple2<MutablePartitionId, PrestoSparkMutableRow> getNext()
                throws InterruptedException
        {
            Tuple2<MutablePartitionId, PrestoSparkMutableRow> next = null;
            while (next == null) {
                if (currentRowTupleSupplier == null) {
                    long start = System.currentTimeMillis();
                    PrestoSparkRowBatch rowBatch = outputBuffer.get();
                    long end = System.currentTimeMillis();
                    timeSpentWaitingForOutputInMillis += (end - start);
                    if (rowBatch == null) {
                        return null;
                    }
                    currentRowTupleSupplier = rowBatch.createRowTupleSupplier();
                }
                next = currentRowTupleSupplier.getNext();
                if (next == null) {
                    currentRowTupleSupplier = null;
                }
            }
            return next;
        }

        @Override
        public long getTimeSpentWaitingForOutputInMillis()
        {
            return timeSpentWaitingForOutputInMillis;
        }
    }

    private static class PageOutputSupplier
            implements OutputSupplier<PrestoSparkSerializedPage>
    {
        private static final MutablePartitionId DEFAULT_PARTITION = new MutablePartitionId();

        private final PrestoSparkOutputBuffer<PrestoSparkBufferedSerializedPage> outputBuffer;

        private long timeSpentWaitingForOutputInMillis;

        private PageOutputSupplier(PrestoSparkOutputBuffer<PrestoSparkBufferedSerializedPage> outputBuffer)
        {
            this.outputBuffer = requireNonNull(outputBuffer, "outputBuffer is null");
        }

        @Override
        public Tuple2<MutablePartitionId, PrestoSparkSerializedPage> getNext()
                throws InterruptedException
        {
            long start = System.currentTimeMillis();
            PrestoSparkBufferedSerializedPage page = outputBuffer.get();
            long end = System.currentTimeMillis();
            timeSpentWaitingForOutputInMillis += (end - start);
            if (page == null) {
                return null;
            }
            return new Tuple2<>(DEFAULT_PARTITION, toPrestoSparkSerializedPage(page.getSerializedPage()));
        }

        @Override
        public long getTimeSpentWaitingForOutputInMillis()
        {
            return timeSpentWaitingForOutputInMillis;
        }
    }

    private static class DiskPageOutputSupplier
            implements OutputSupplier<PrestoSparkStorageHandle>
    {
        private static final MutablePartitionId DEFAULT_PARTITION = new MutablePartitionId();

        private final PrestoSparkOutputBuffer<PrestoSparkBufferedSerializedPage> outputBuffer;
        private final TempStorage tempStorage;
        private final TempDataOperationContext tempDataOperationContext;
        private final long writeBufferSizeInBytes;

        private TempDataSink tempDataSink;
        private long timeSpentWaitingForOutputInMillis;

        private DiskPageOutputSupplier(PrestoSparkOutputBuffer<PrestoSparkBufferedSerializedPage> outputBuffer,
                TempStorage tempStorage,
                TempDataOperationContext tempDataOperationContext,
                DataSize writeBufferSize)
        {
            this.outputBuffer = requireNonNull(outputBuffer, "outputBuffer is null");
            this.tempStorage = requireNonNull(tempStorage, "tempStorage is null");
            this.tempDataOperationContext = requireNonNull(tempDataOperationContext, "tempDataOperationContext is null");
            this.writeBufferSizeInBytes = requireNonNull(writeBufferSize, "writeBufferSize is null").toBytes();
        }

        @Override
        public Tuple2<MutablePartitionId, PrestoSparkStorageHandle> getNext()
                throws InterruptedException
        {
            long start = System.currentTimeMillis();
            PrestoSparkBufferedSerializedPage page = outputBuffer.get();
            if (page == null) {
                return null;
            }

            long compressedBroadcastSizeInBytes = 0;
            long uncompressedBroadcastSizeInBytes = 0;
            int positionCount = 0;
            CRC32 checksum = new CRC32();
            TempStorageHandle tempStorageHandle;
            IOException ioException = null;
            try {
                this.tempDataSink = tempStorage.create(tempDataOperationContext);
                List<DataOutput> bufferedPages = new ArrayList<>();
                long bufferedBytes = 0;

                while (page != null) {
                    PageDataOutput pageDataOutput = new PageDataOutput(page.getSerializedPage());
                    long writtenSize = pageDataOutput.size();

                    if ((writeBufferSizeInBytes - bufferedBytes) < writtenSize) {
                        tempDataSink.write(bufferedPages);
                        bufferedPages.clear();
                        bufferedBytes = 0;
                    }

                    bufferedPages.add(pageDataOutput);
                    bufferedBytes += writtenSize;
                    compressedBroadcastSizeInBytes += page.getSerializedPage().getSizeInBytes();
                    uncompressedBroadcastSizeInBytes += page.getSerializedPage().getUncompressedSizeInBytes();
                    positionCount += page.getPositionCount();
                    Slice slice = page.getSerializedPage().getSlice();
                    checksum.update(slice.byteArray(), slice.byteArrayOffset(), slice.length());
                    page = outputBuffer.get();
                }

                if (!bufferedPages.isEmpty()) {
                    tempDataSink.write(bufferedPages);
                    bufferedPages.clear();
                }

                tempStorageHandle = tempDataSink.commit();
                log.info("Created broadcast spill file: " + tempStorageHandle.toString());
                PrestoSparkStorageHandle prestoSparkStorageHandle =
                        new PrestoSparkStorageHandle(
                                tempStorage.serializeHandle(tempStorageHandle),
                                uncompressedBroadcastSizeInBytes,
                                compressedBroadcastSizeInBytes,
                                checksum.getValue(),
                                positionCount);
                long end = System.currentTimeMillis();
                timeSpentWaitingForOutputInMillis += (end - start);
                return new Tuple2<>(DEFAULT_PARTITION, prestoSparkStorageHandle);
            }
            catch (IOException e) {
                if (ioException == null) {
                    ioException = e;
                }
                try {
                    if (tempDataSink != null) {
                        tempDataSink.rollback();
                    }
                }
                catch (IOException exception) {
                    if (ioException != exception) {
                        ioException.addSuppressed(exception);
                    }
                }
            }
            finally {
                try {
                    if (tempDataSink != null) {
                        tempDataSink.close();
                    }
                }
                catch (IOException e) {
                    if (ioException == null) {
                        ioException = e;
                    }
                    else if (ioException != e) {
                        ioException.addSuppressed(e);
                    }
                    throw new UncheckedIOException("Unable to dump data to disk: ", ioException);
                }
            }

            throw new UncheckedIOException("Unable to dump data to disk: ", ioException);
        }

        @Override
        public long getTimeSpentWaitingForOutputInMillis()
        {
            return timeSpentWaitingForOutputInMillis;
        }
    }

    private enum OutputBufferType
    {
        SPARK_ROW_OUTPUT_BUFFER,
        SPARK_PAGE_OUTPUT_BUFFER,
        SPARK_DISK_PAGE_OUTPUT_BUFFER,
    }
}


Dai-Dong Fire Protection Co., Ltd.
P & A Agencies Ltd have an established team of sales agents covering the whole of the UK. Representing Danish brand Dansk Smykkekunst Copenhagen.
We are suppliers of original artwork to the trade and represent over thirty artists offering both traditional and contemporary work.


text:
SUSTAINABLY SOURCED.
ETHICALLY REFINED.
Excir has pioneered a powerful proprietary
technology that enables the ethical and
sustainable extraction of precious metals.
ENABLING A
SMALL-SCALE REFINING
Our powerful proprietary technology brings unprecedented efficiency to the rapid extraction of precious metals. Excir has the potential to help close the loop on the Circular Supply Chain.
Each gram of precious metal we produce has 'verified provenance' that provides assurance that all precious metals are ethically sourced and 100% traceable to their origin.
Excir technology allows for the efficient extraction of precious metals from alternative mining sources including E-waste. The Excir lixiviant is a an extremely mild and eco-friendly solution that can be recycled with negligible environmental impact.
WE ARE A CATALYST
FOR CHANGE.
We have pioneered an innovative technology that quickly, safely
and selectively, extracts precious metals — specifically gold, palladium,
and platinum — from substrates. Excir brings new light to responsibly monetizing age-old problems. We are quickly leveraging our successes
from the E-waste vertical into R&D on Spent Catalyst and Mining verticals.
ELECTRONICWASTE
Our technology recovers 99%+ of gold from select E-waste in a matter of seconds. Excir's truly artisanal cutting-edge technology offers a different solution to the world's fastest growing waste stream by creating significant economic value from previously untapped sources.
Leveraging from our E-waste R&D success we are now focusing committed resources
on the recovery of precious metals from spent catalysts with an initial focus on
catalytic converters. Today, there is not an impactful
solution in country to
recover the precious metals
and all catalytic converters
are currently exported to smelters abroad.
Excir understands our role as an ethical steward of the planet's
finite natural resources. Our end goal is to have a significant
impact on industry's use of cyanide within mining.
CHIEF EXECUTIVE OFFICER & DIRECTOR
Mr. Fox joined Excir and assumed the CEO role after spending the last 3 1/2 years at the University of Oxford. Jim holds an Executive MBA and a Post Graduate
Masters Diploma in Global Business from the Saïd
Business School at Oxford. He is also a graduate
of the General Management Program Harvard
Business School. While at Oxford, he headed
up Ethos Angel Investment Fund and prior to that
spent 10 years at National Oilwell Varco, with his final
role being the Vice President of Operations for Canada.
Stephen Foley, PhD
Dr. Foley is one of the three main inventors of Excir's technology. Stephen has more than 20 years research experience in the general field of Inorganic Chemistry and is a Professor at the University of Saskatchewan. His recent research has focused on developing new extraction methods for recovery and purification of precious metals.
Chris Bowman, PhD
Mr. Bowman is a portfolio manager with the University of Saskatchewan, with a specialty in the transfer of
the University's technologies in physical science and engineering to industry. He has expertise in technology evaluation, scale-up and licensing. He holds a PhD in applied mathematics from the University of Arizona.
©2019 Excir. All Rights Reserved. Sustainably Sourced. Ethically Refined.™ Registered Trademarks, ServiceMarks, and Patents Pending.

redpajama_set_name: RedPajamaCommonCrawl


Raul's Articles This is a list of the latest articles and blog entries that Raul has written. I am not an atheist from my scientific perspectiveWe are living in an Information SocietyWe're Suffering and Dying From Diseases Whose Treatments Are Still UnknownWe are not living in a simulation. How to prove it? Click here to read all of Raul's articles.
Click here to see all of Raul's photos.
Blogroll Raul hasn't added any blog recommendations yet.
Recommended Books Raul hasn't added any book recommendations yet.
Affiliates Raul hasn't added any affiliates.
Raul hasn't added any friends yet.


3. NO need for any deposit for small groups, please pay CASH on the spot to a tourguide. I accept any currency.
5. Pick and drop off place will be discussed.
Up to 3 people I will drive you in my VW station wagon, for more than 3 people I will hire a minivan with a professional driver.
Hobbit's place or wine cellars?


text:
News|Kurds
Kurds pledge to fight Turkey to retain Syria's Manbij
Turkish president's plan to clear Kurdish forces from Syrian city and set up a safe zone meets with Kurdish defiance.
The commander of Kurdish fighters in Syria's Manbij city has told Al Jazeera that his forces will fight to defend any move by Turkey to take over the area.
Adnan Abu Amjad's comment came after Turkish President Recep Tayyip Erdogan said that when his country's forces finished helping Syrian opposition fighters take over Al Bab from ISIL , they would move on to Manbij and then ISIL's self-declared capital Raqqa.
Erdogan said he wants to set up a safe zone near the Turkish border and clear all Kurdish forces from the area.
Abu Amjad said: "If Erdogan wants to come to Manbij, it's his business, but we will defend our city with all the strength we can find. As Syrian people, we'll resist any interference in our internal affairs."
WATCH: Syria's war – Peace talks take place in Astana (2:14)
Air strikes carried out by the US-led coalition and a long fight by mainly Kurdish ground forces freed Manbij from the control of the Islamic State of Iraq and the Levant (ISIL) group last year.
However, the US backing for Syrian Democratic Force (SDF) – an alliance dominated by the Kurdish YPG militia – has caused anger in Turkey.
Since Donald Trump became the US president, Erdogan has offered to join the fight against ISIL, also known as ISIS, in Raqqa. But he does not want Kurds , who had launched a campaign to encircle the city in November, to participate.
It is not yet clear whether Trump's administration will provide weapons to the YPG over Turkey's objections.
The US says weapons provided to the SDF are so far limited to its Arab elements, but Turkey says the arms are going to the SDF and is asking for a halt.
Elsewhere in Syria , the besieged, rebel-held district of al-Waer in Homs city was bombed by Syrian warplanes on Saturday.
The Syrian Observatory for Human Rights (SOHR), the Britain-based monitoring group, said three people were killed in the attack on Saturday.
The latest violence brought the death toll since the bombardment of the district resumed earlier this month to at least 30 people.
An opposition media activist in al-Waer said two people were killed in Saturday's bombing and the overall toll this month was more than 20.
Pro-Syrian government media outlets have said strikes were in response to rebels firing at residential areas of government-held Homs neighbourhoods.
'Government strategy'
Syria has tried to conclude a deal in al-Waer that would see rebel fighters and their families leave the district and the government take over.
Under similar local agreements in other parts of western Syria, rebels have left with light weapons and headed mostly for Idlib province.
The opposition says such agreements are part of a government strategy to forcibly displace populations from opposition-held areas after years of siege and bombardment.
In September, about 120 rebel fighters and their families left al-Waer in agreement with the government , but there have been no further reports of rebels leaving.
The SOHR estimates several thousand fighters remain there.
FEATURED DOCUMENTARY: The Boy who started the Syrian War (47:36)
Syria's war explained from the beginning
On March 15, the war entered its eighth year.
Looking to the future on Syria Street
New project tells the stories of ordinary people affected by violence and poverty in the Lebanese city of Tripoli.
Can Astana talks be turning point to end Syria war?
Russia is throwing its weight behind a political solution by organising negotiations in Kazakhstan's capital.


text:
Stylosomus minutissimus es una especie de insecto coleóptero de la familia Chrysomelidae.

Distribución geográfica
Se distribuyen por el sur de Europa y el noroeste de África.

Fue descrita científicamente en 1824 por Germar.

Referencias

Enlaces externos

Coleópteros de Europa
Coleópteros de África del Norte
Animales descritos en 1824
Stylosomus

redpajama_set_name: RedPajamaWikipedia


text:
Ted Rogers Centre for Heart Research > Engineering Medicine > Inside a damaged heart cell, we see how proteins reorganize and contribute to cardiac hypertrophy
Inside a damaged heart cell, we see how proteins reorganize and contribute to cardiac hypertrophy
Patients with pathological cardiac hypertrophy have a thickened heart that has a reduced ability to pump blood throughout the body. This debilitating condition is linked to inflammation, fibrosis and cell signaling disruptions, and leads directly to heart failure.
It is not uncommon and its molecular mechanisms – what happens in our bodies that gives rise to this condition in the first place – is not well understood. In science, when faced with persistent difficulty, new approaches to studying a disease are in order.
The world-class labs of Chris Yip, Anthony Gramolini, Craig Simmons and Scott Heximer blended innovative imaging, physiology, biochemistry, bioengineering and surgery in a new investigative approach to this disease. (The latter three labs belong to the Ted Rogers Centre's Translational Biology and Engineering Program.)
The conventional approach in labs is to measure the level of molecules and proteins, and how their fluctuations are tied to disease. This time, in a bid to unearth new answers, these labs explored proteins in an injured heart cell in a new way.
Tracking the movement of proteins
"Our novel approach was to figure out where and if these proteins moved around, reorganizing themselves," says Sina Hadipour-Lakmehsari, first author of the study published in Nature Scientific Reports. "It's a different way of thinking about what happens inside a cell, one where we can gain a greater depth of knowledge about the molecular basis of this disease."
Imperative to the study was the use of dSTORM microscopy – super resolution imaging that accurately detected those protein locations. That element was led by Christopher Yip, Dean of the Faculty of Applied Science & Engineering at U of T, who is a global leader in molecular imaging – a field advancing at breakneck speed.
"By pinpointing the precise location of these molecules within an affected cell, we can understand how the proteins are functioning," says Anthony Gramolini, Ted Rogers Centre principal investigator. "If there is any change as to where those molecules are, it will have profound effects on that function and suggest new clues to how this disease develops."
What they discovered about calcium
Cardiomyocytes (heart cells) require calcium to beat and contract. Some proteins are responsible for adding calcium if higher levels are needed, and some remove excess calcium from a cardiomyocyte. How calcium-regulating proteins are dispersed amidst pathological cardiac hypertrophy is the key finding of this study.
The team discovered that, after a heart suffers damage, cardiomyocytes start to widely disperse proteins that boost calcium levels in the cell. But those proteins that remove calcium appear to cluster together in tight groups, unable to effectively function. The result is a widespread calcium overload – which can play a role in the structural remodeling of cardiomyocytes and the progression of pathological hypertrophy.
"This is an important step to understanding what is happening in cardiac hypertrophy, which hasn't been yet considered," says Gramolini. "This multi-lab study is a direct result of the Ted Rogers Centre, which enabled the collaborations of different experts, and has built momentum in our scientific pursuit of heart failure."
This model of investigation – tracking the movement of proteins – is applicable to almost every disease. Getting the right researchers working together can uncover new insights into human health simply by reimagining the way we approach studies at the molecular level.
Image: 1. Upper panel – dSTORM super-resolution imaging of a molecular channel (RyR2) involved in calcium release in cardiomyocytes. 2. Bottom panel – dSTORM super-resolution imaging of a molecular protein (SERCA2A) involved in calcium uptake in cardiomyocytes.


All work and no play makes Jack a dull boy. While I would hope you wouldn't turn into a ax wielding maniac. It is a good idea to make sure you are scheduling time to keep your mind fresh and to feed your creativity. As a solopreneur you have to be the one that seeks out inspiration. Here are a few tips on keeping your ideas fresh and keeping you from going all "Here's Johnny".
Visit museums in town, go to the library, go on a hike, go shopping, get out of the house! Go to a place you have not visited before, seek out the new. Find places that give you a new perspective or change of scenery, even if it is just for an afternoon.
There is tons of buzz around introverts and extroverts and who likes to do what and how so and so works. I think regardless of your "category" getting out and talking to other creatives is beneficial. Look for meet-ups or other events in your local that are related to your area of interests. While I think face-to-face is important, online interaction can be just as valuable. Find Facebook or other online networks to join too.
Find those you think are at the top of your field and follow them. Go to industry events. Keep up to-date with news and developments around your area of interests. Seek out webinars and other learning opportunities.
Have a few boards that keeps you motivated and focused as something to work towards. If you are just starting out or still in the "just thinking" stage, keep inspiration boards for your future website, logo, branding. It's good to have a visual to keep you motivated. If you are established in your business, keep inspiration boards for passive income ideas, new products, or projects. Pinterest of course if my favorite for this.
You never know when inspiration might strike. Get away from just your industry and your tribe, talk to people in other industries, seek out new, fresh inspiration. Try a new hobby, try a course in a new skill, or a webinar that is not directly related to your business. Seeking out new experiences is a great way to spark new fresh ideas.
Having a business that is 100% your own, can mean it is easy to have your business take over 100% of your life. Make sure you are not so caught up in the day to day of running your business, that you don't make time for inspirational breaks. Keep your business growing by giving yourself time and mind space to think of new, fresh, and future ideas.
What's your favorite way to spark inspiration?


text:
The Appreciation Enthusiast
Music, Film, Pop Culture.
Follow The Appreciation Enthusiast on WordPress.com
Written by Ant
Music in general has it's fair share of "legends" and "heroes", however, it seems that these days the most pressure is on rap legends to release music that can top their old releases. That simply isn't possible.
Recently, Eminem has been at the center of the cross-hairs with his hype and release of Revival. Revival was going to be Eminem's big comeback and best record since The Marshall Mathers LP 2 which came out in 2013. When Revival came out it was met with harsh criticism and very split opinions. Revival is the music equivalent of Star Wars: The Last Jedi in terms of the division of the fan base. The album was assumed to be great based on his track record and recent freestyle and protest against Donald Trump, however, think about Eminem's past releases and how "good" they were.
Eminem has constantly dissed his own album Relapse and is known to dislike and seemingly hate that album. The real twist is that most fans really do like Relapse especially big names like Tyler, the Creator. Although Eminem is allowed to dislike his work notably when you take into account his personal life at that point and his issues with drug abuse. Having a commercial and critical failing album is a good enough reason to dislike it, however, when we look at Revival that dislike from critics and fans is multiplied exponentially. Why do the fans expect so much from these musicians specifically when they've released non-favorable albums before.
The legendary status given to Eminem is very much earned and the result of years upon years of hard work, but what does that title really mean? Does Eminem have to consistently compete with his old work? Does he have to once again become the Rap God? These questions can be quite taxing on a musician and their fans because these expectations aren't realistic. To say Eminem must put out an album better than his 2000 album The Marshall Mathers LP is next to impossible.
Revival instead is a complicated yet interesting display of lyrical talent and skill. The lyrics and rhyme patterns that Eminem has been perfecting over the years is quite astonishing considering that most modern day artists never go that far in depth with their rhymes. Revival isn't supposed to be his best album or comeback, it's simply an update of where Eminem stands politically, personally, and lyrically. With the album standing at mostly a 50% score it's easy to see the divided sides argue due to the misleading expectations.
Eminem is a legend in rap, and a master of his own craft. The expectations for him are out of this world due to this legendary status, however, each listener is allowed to form their own opinion on Revival and Eminem as a legendary icon. The only true statement that most agree with, is that Eminem helped make modern rap great. Eminem was a unique anomaly in the 2000's due to his style and skin. Eminem is a legend in his own right, and deserves to be recognized as someone who is responsible for today's artists and the future artists. Revival may not be his best work, but it does have immortal lyrics and stories to share to the world.
Eminem earned the title of Rap God and thus needs to push forward and once again display his talent as the Rap God in due time.
Previous Post 17 Songs of 2017
Next Post Across the Pond
5 Comment on "Legends"
Chocolate Hun🍫 January 2, 2018 at 5:44 pm
I agree completely with everything that has been said. However, as a fan of Eminem, in my opinion, he doesn't need to prove to the world that he is the Rap God when he already is. As you said, and he said also in "Walk on Water", people are expecting him to top the charts when he's really just using his art as a platform to tell the world how he feels about what's going on. The critics and persons with very high expectations fail to see that and will continually judge him and expect him to release music just like he did years ago. Eminem is the Rap God amid harsh criticisms and high expectations.
Ant January 3, 2018 at 1:05 pm
He'll always be the Rap God in my books. He's done more than earn that position.
MusiCommentator January 3, 2018 at 12:53 pm
Legacies are impossible to live up to. No matter how hard you try, people always see the originals as the best, so nothing you make would be able to surmount your old stuff, because it is not your old material you are trying to beat, it is peoples' expectations.
Ant January 3, 2018 at 12:59 pm
Well put! I agree completely with you, people want too much from entertainers.
Niko Bellini January 12, 2018 at 10:57 pm


text:
Flexible Ablator for Thermal Protection
NASA has developed a class of low-density, flexible ablators that can be fabricated into heat-shields capable of being packaged, stowed, and deployed in space. The key characteristics of this new...
Toughened Uni-piece Fibrous Reinforced Oxidation-Resistant Composite (TUFROC)
The Toughened Uni-piece Fibrous Reinforced Oxidation-Resistant Composite (TUFROC) allows for much more affordable and sustainable operations involving Space Launch Services and other systems that utilize Earth re-entry vehicles. TUFROC has an exposed surface design and...
Catalytic Oxidation of Organic Contaminants at Reduced Pressure
The current technology for catalytic oxidation of aqueous organic contaminants at elevated temperature and pressure works well at operating conditions of 265 °F and 70 psia with effluent TOCs (total organic carbon) of less than 0.5 ppm. However, it does not perform well at the...
Approach for Achieving Flame Retardancy While Retaining Physical Properties in a Compatible Polymer Matrix
NASA's Kennedy Space Center (KSC) seeks to license its Advanced Fire Retardant Materials to industry. KSC's scientists have developed processes and know-how to impart fire retardancy to common polymers such as nylons, polyesters, and...
Polyimide Aerogels with Three-Dimensional Cross-Linked Structure
NASA-developed polyimide aerogels are 500 times stronger than conventional silica aerogels. The innovative aerogels represent a revolutionary advance over fragile silica...
Metal/Fiber Laminate and Fabrication Using a Porous Metal/Fiber Preform
NASA's Langley Research Center has developed a new technique to enable the preparation of metal/composite hybrid laminates, also known as fiber metal laminates (FML),...
Method for Exfoliation of Hexagonal Boron Nitride
NASA's Langley Research Center has developed a method for exfoliating commercially available hexagonal Boron Nitride (hBN) into nanosheets a few atomic layers thick. Currently, hBN has limited use because it is insoluble with limited dispersibility, despite hBN having excellent thermal...
Sucrose-Treated Carbon Nanotube and Graphene Yarns and Sheets
NASA's Langley Research Center has developed a method to consolidate carbon nanotube yarns and woven sheets and graphene sheets via the dehydration of sucrose. The resulting...
Method for Manufacturing a Thin Film Structural System
NASA's Langley Research Center has developed a technology that uses commercially available additive print manufacturing to add various levels of structural hierarchy to thin-film...
Ultralow-Temperature-Operable Solid Propellant Binder
A unique binder was developed that exhibits a glass transition temperature of –100 °C, which is more than 50 °C lower than that of traditional HTPB (hydroxyl-terminated polybutadiene) and CTPB (carboxyl-terminated polybutadiene) binders. This innovation would be a solid propellant that...
Carbon Nanotube-Assisted Microwave Healing of Thermally Re-Mendable Composites
A method creates thermally healable composites using carbon nanotubes. Carbon nanotube microwave heating provides a pathway to overcome issues associated with electrical resistive heating networks. Carbon nanotubes embedded within a thermally reversible polymer can be...
Integrated Ceramic Matrix Composite-Carbon/Carbon Structures for Large Rocket Engine Nozzles and Nozzle Extensions
Low-cost access to space demands durable, cost-effective, efficient, and low-weight propulsion systems. Key components include boost and upper stage rocket engine nozzles and extensions. Nozzle material options include ablatives,...
Aromatic Thermosetting coPolyester (ATSP) Composites for High-Temperature and Cryogenic Applications
Advanced composite materials processable by cost-effective manufacturing play an important role in developing lightweight structures for future space and planetary exploration missions. With the growing demand for improved performance in the...
Aluminoborosilicate Supplement for Thermal Protection of a Re-entrant Vehicle
The Toughened Uni-piece Fibrous Reinforced Oxidation-Resistant Com posite (TUFROC) allows for much more affordable and sustainable operations involving Space Launch Services and other systems that utilize Earth reentry vehicles. TUFROC has an exposed surface design and...
Processing and Manufacture of Inorganic-Organic Hybrid Syntactic Structural Cryogenic Insulator
Reducing the cost and weight of launch structures is essential to meeting NASA goals for reliable access to space. Currently, separate systems are used for structure and pressure containment, cryogenic insulation, and high-temperature insulation. One...
Multifunctional Ablative Thermal Protection System
NASA has developed a unique and robust multifunctional material called 3-Dimensional Multifunctional Ablative (3DMAT) Thermal Protection System (TPS) that meets both the structural and...
Hierarchical Support for Nanocatalysts
This work focused on enhancing catalyst activity and durability by developing a method to control size, dispersion, and exposure. Existing nanocatalysts are typically fabricated in bulk or powder form. There are monolithic catalysts, but they rely on meso-porous materials as supports. Bulk nanocatalysts...
Control of Carbon Nanotube Density and Tower Height in an Array
Use of arrays of carbon nanotubes (CNTs) as an intermediary for transport of electrical particles (e.g., electrons) and/or transport of thermal energy from one body to another has grown. For example, a CNT array may be used for dissipation of thermal energy or accumulated electrical...
In-Situ Chemical Analysis of Material Surfaces
In order to understand whether the ablation laser would cause chemical reactions within the trapped organic molecules during resonant laser ablation of water ice containing organic molecules, a...
Colorimetric Indicator for Detection of AF-M315E
An easy and instant method of detection was needed for AF-M315E, a "green" propellant that produces very little vapor. This makes it hard to detect by smell or other active sensors.
Oriented Nanofibers Embedded in a Polymer Matrix
A method of forming a composite of embedded nanofibers in a polymer matrix with a high degree of alignment has been created using a nanofiber continuous fiber (NCF) system. This innovation incorporates nanofibers in a plastic matrix forming agglomerates, and then uniformly distributes them by...
Flexible, High-Temperature Polyimide/Urea Aerogels
Cross-linked silica-based aerogels with polymeric materials, as well as incorporating a flexible linkage into the underlying metal oxide, have been proven to improve strength and resilience over their native, or non-cross-linked, counterparts without adversely affecting porosity and density. In...
Multilayer Insulation Systems
Cryogenic fluid management (CFM) is a critical technical area that is needed for the successful development of future space exploration. A key challenge is the storability of LH2, LCH4, and...
Low-Scatter Starshade Edges
A starshade occulter is a large space structure whose shape is specially designed to produce a diffraction pattern in starlight that can aid a telescope in direct imaging of exoplanets. The diffraction pattern...
Thermal Management Coating (TMC)
An experimental study was conducted in conjunction with the research and development program at the NASA Marshall Space Flight Center (MSFC) on thermal protection systems (TPS) for aerospace applications, a...
AeroHeating Tools (AHT) Suite
This suite of computer programs, called "tools," is used to calculate local flow angles over damage sites in the Shuttle Orbiter Thermal Protection System (TPS). It provides a quick and easy way to compute cross flow angles over points of interest on the Shuttle Orbiter TPS.
Briefs: Information Technology
EXOS Software
An improved version of EXOS software allows for the modeling of fabrics, mixtures, and porous materials, and also provides the ability to accept hex mesh geometries. The code employs a novel numerical method, a hybrid particle finite element approach, as well as particles and elements in tandem, each modeling distinct aspects of...
Processing and Damage Tolerance of Continuous Carbon Fiber Composites Containing Puncture-Self-Healing Thermoplastic Matrix
The initiation and propagation of damage ultimately results in failure of aircraft structural components. Often, impact damage is difficult to identify in-service, and hence design of continuous carbon fiber reinforced...
Advanced Supported Liquid Membranes for CO'2 Control in EVA Applications
NASA has a clear need to develop new technology in support of its future goals, including missions beyond low-Earth orbit, the possible development of lunar outposts, and the eventual exploration of Mars. As these missions develop, it is anticipated that crew members will...
Tiny Fibers in Fabric Could Turn Sun's Heat Into...
Method Could Advance Next-Generation Liquid...
Super-Secure, Self-Erasing Memory Chip
An Alternative to Leather Starts with Silk
Sensors/Data Acquisition
Intelligent Soft Material Curls Under Pressure
Shape-Shifting Materials Inspired by Metamorphosis
Extending Next-Generation, Stable Lithium Metal...
Product Spotlight: EP41S-5
Marine Sponge Design for Stronger Skyscrapers and...
NASA's Handheld Laser Torch Welds Hard-to-Reach...
A Novel Twist to Flexible LEDs
Structural Battery for Lighter Aircraft and...
Sensitive and Resilient Slinky-Like Sensor for...


This one owner barely lived in Highland home boasts 5 bedrooms and 3 full baths including the master retreat with en-suite, a garden tub, dual sinks, makeup vanity, separate shower, large walk-in closet. Downstairs guest room with walk-in closet and private bathroom; Executive study; Formal Dining; eat-in kitchen with white painted cabinets and Stainless Steele appls; granite counters, an island which opens to the family room with cozy fireplace making this the perfect place for entertaining. Upstairs you will find 3 bedrooms and 2 full baths, game room, light bright open floor plan with lots of upgrades and engineered wood floors, extended patio perfect for providing shade to enjoy the sunsets.


text:
Toro Loco opens in Farmington, bringing Mexican and Spanish tapas, housemade tortillas, and lots of tequila
Party Spoiled: Chiefs Drub Patriots 42-27 In Opener
By SAM FARMER
Los Angeles Times |
FOXBOROUGH, Mass. — They cheered. They danced. They high-fived.
Thursday was a night of celebration for the New England Patriots.
Until the Kansas City Chiefs came to life.
In a resounding upset of the defending Super Bowl champions, the visiting Chiefs relied on a pristine performance by quarterback Alex Smith and the scorching speed of Tyreek Hill and rookie Kareem Hunt to deliver a 42-27 defeat that left Gillette Stadium as quiet as a library.
[Related] Tom Brady most dominant player in AFC championship history »
The same crowd that toasted the five-time Super Bowl champions, booed NFL Commissioner Roger Goodell, and cheered wildly as the latest banner was unfurled, headed for the exits in stunned disbelief.
The Patriots, favored by nine, had won eight in a row when opening the season at home. Even without star receiver Julian Edelman, done for the year with a knee injury, they are loaded with talent. They almost went up by two touchdowns in the first six minutes … but there was no writing off the Chiefs, who finished with 537 yards of offense.
So much for first impressions. Hunt coughed up the ball on Kansas City's first play from scrimmage — a guy who never lost a fumble in four years at Toledo — then put on an amazing show. He finished with 243 yards from scrimmage and three touchdowns, including a catch and carry that covered 78 yards.
Smith was brilliant, completing 28 of 35 for 368 yards and four touchdowns. That vastly eclipsed Tom Brady, who completed 16 of 36 for 267 yards, with no touchdowns or interceptions, and was under heavy pressure, especially after losing security blanket Danny Amendola to a concussion.
The Chiefs took a 21-17 lead just before the midway point of the third quarter, when speedster Hill got behind the defense and turned a long pass into a 75-yard touchdown. He was so far ahead of his pursuers after making the catch, he turned and shot them the peace sign.
[Related] Warrant issued for Odell Beckham after video shows butt swat »
The Patriots led at halftime, 17-14, but the game initially felt more lopsided than that.
New England opened with a touchdown drive, then got the ball right back when Hunt fumbled on the visitors' first play from scrimmage.
The Patriots took possession at the Kansas City 32 and moved all the way to the 10, threatening to take a two-touchdown lead with less than six minutes expired. That's when the Chiefs made a huge play, stuffing the run for no gain on fourth-and-1 from their 10.
Then, Kansas City responded with a 90-yard scoring drive that culminated with a 7-yard touchdown pass from Smith to tight end Demetrius Harris.
Still, the Patriots were knocking on the door throughout the opening quarter, with 20 of their 27 snaps coming in Chiefs territory.
[Related] Report: Patriots QB Tom Brady moves into Greenwich mansion »
Scoring both of New England's touchdowns in the first half was running back Mike Gillislee, formerly of Buffalo, a free agent acquisition in the offseason. He would score a third touchdown to reclaim the lead in the third quarter.
Report: Patriots QB Tom Brady moves into Greenwich mansion
The home crowd was buzzing to celebrate the defending Super Bowl champions, who unveiled their fifth banner during a pregame celebration that included a live performance by the rapper Flo Rida, and with hometown favorite Mark Wahlberg acting as master of ceremonies.
Goodell was in attendance and was booed loudly when he walked onto the visitors' sideline before the game to talk to Chiefs owner Clark Hunt.
Goodell is public enemy No. 1 among Patriots fans, who feel he unfairly punished quarterback Brady for an alleged football-deflating scheme. Although this was shaping up to be Goodell's first trip back to Gillette since Brady served his four-game suspension, the commissioner actually attended an exhibition game here in August.
"It's very emotional," said season-ticket holder Andrew Dellolio. "He threw our quarterback under the bus and tried to ruin his name. If they shine the camera on him, there are going to be so many boos."
Drug charge to be dropped against Patriots safety Patrick Chung
Chiefs rally from 24-0 hole to beat Texans, advance to AFC Championship Game
Martin Luther King Jr.'s time in Connecticut was pivotal, but has never been thoroughly documented; that's about to change


Are there things that you wish others knew and could understand when life brings real heart wrenching pain and your grief overpowers every dream you hold dear? Sometimes people with good intentions say foolish and harmful things to those suffering. Words can wound an already broken heart to the point of devastation instead of giving hope and strength in an ongoing crisis.
Someone in sorrow needs for you to come along side and give them encouragement through a touch of compassion, and a tearful, tender heart (Romans 12:15). Even though the question, "How are you doing?" seems like the right thing to ask, it can seem to the wounded and distressed that they need to give a report of their actions, thoughts, or emotions. There's not a time limit on grieving and people from all walks of life suffer differently.
Expressing an impatient attitude towards a hurting person is jarring to the senses. It can cause despondency; the loss of hope, and despair; the feeling that no favorable outcome will ever exist. Be thoughtful in quoting Scripture such as, Romans 8:28, most likely, things are not good for them right now, nor does it seem like there will ever be anything positive come out of their circumstances.
Thank you for reading the blog and writing me to let me know. I appreciate your comments and that you enjoyed reading it. Thank you again!


text:
Samuel Schepps (? – 12 January 1936), also known as Schapps, was a New York City mobster with the Monk Eastman Gang. Schepps ran gambling houses for Jack Zelig as part of his work with the gang.

Biography
On July 16, 1912, Herman Rosenthal was murdered in front of the Hotel Metropole in New York City.  Schepps was identified by coconspirators as the "paymaster" of the plot to kill Rosenthal. Within the week, Schepps had disappeared and was believed to have left New York.  He was tracked down and, on August 10, 1912, was arrested in Hot Springs, Arkansas.  Sick and broke when he was caught, Schepps was reportedly happy to return to New York to testify against his accomplices.  The fact that Schepps was hiding in Hot Springs was revealed to police by Harry Vallon, an accomplice in Rosenthal's murder. Vallon, along with Schepps and other mob informants Bridgey Webber and Jack Rose, testified at the Becker-Rosenthal trial. His testimony resulted in the conviction of Charles Becker and the four gunmen involved in the murder.

Schepps and his brother Nathan later ran an antique and jewelry store, the Maison Cluny, at 437 Madison Avenue. In October, 1921, the famed soprano Lydia Lipkowska charged Schepps with usury over his refusal to return two diamonds worth $80,000 that she had pawned to him.  Lipkowska said that she had borrowed $12,000 and had left the diamonds with Schepps as security and that he sought $5000 in interest before he would return the jewels.

On October 3, 1933, he and Nathan were arrested and charged with forgery in connection with falsified checks worth over $10,000, which they had deposited in their business's bank account.

Sam Schepps died on January 12, 1936, in the Fifth Avenue Hospital.

References

Rosenthal murder case
Federal Bureau of Investigation informants
1936 deaths
Eastman Gang
Year of birth missing


SYNOPSIS André Rieu's annual hometown Maastricht concerts attract fans from all corners of the globe. The medieval town square is transformed into a spectacular backdrop for unforgettable concerts filled with humor, fun and emotion for all ages – and, of course, magnificent music. This year's theme is a dedication to the waltz.


GetReligion | 4/9/2019 | Bobby Ross Jr.
There was a time pop culture was more easily interpreted as something of a statement on the national mood, because the existence of fewer choices meant creators had to appeal to broader audiences.
L. Grossman. 4 things we'll learn from the first closeup image of a black hole. Science News Online, March 29, 2019. E. Conover. Three gas clouds nearly grazed the edge of the Milky Way's black hole.
Emperor Akihito of Japan is abdicating and passing the office to his son, Crown Prince Naruhito, and as part of the transition comes a new gengo, or era name: "Reiwa.
The tides are shifting. Something's in the wind. And it's not just the fecund vapors of spring. The political soap opera of RussiaGate ended like a fart in a windstorm last weekend, leaving Mr.
Ambots, an Arkansas-based 3D printing technology and assembly provider, has developed a class of mobile robots, which the founders say will initiate a new kind of digital factory.
On Friday a man in his late 20s was charged with murdering at least 49 people and seriously injuring 20 more, in a terror attack targeting two mosques in the New Zealand city of Christchurch.
WASHINGTON (Reuters) – If you need to get news out of the federal courthouse in Alexandria, Virginia, bring plenty of quarters. Cellphones and laptops aren't allowed in the building.
PARIS (Reuters) – A global effort to revamp international tax rules for the digital era is receiving less corporate push-back than past attempts, the OECD's head of tax policy said on Tuesday.
(CNSNews.com) - The economy added a meager 20,000 jobs in February, well below the 180,000 that analysts were expecting, and the lowest number of the Trump administration.
The University of Wisconsin-Madison hosted an event on Tuesday suggesting that Central American economic migrants are refugees, just as Jews were refugees "during the Nazi era.


Or, view all airports in Nigeria.
it is very sad.........that the biggest airport by Land mass in whole Nigeria i.e Akure Airport, an airplane can not land at Night time! Please get it fix and also work on the Instrument Landing System too, not for but for the future!
Do you have vets for cats to be shipped ?
Have you used Akure Airport? Love it? Hate it? We welcome your reviews, questions, or comments about the airport. Your feedback, if suitable, will be published on this page for the benefit of other users.


When you stay at Armagh Country Lodge & Spa in Storms River, you'll be within the vicinity of Tsitsikamma National Park.
Make yourself at home in one of the 8 air-conditioned rooms featuring refrigerators and DVD players. Rooms have private balconies. Conveniences include safes and coffee/tea makers.
Take advantage of recreational opportunities offered, including a health club, an outdoor pool, and a seasonal outdoor pool. Additional amenities include babysitting/childcare, tour/ticket assistance, and barbecue grills.
Enjoy a satisfying meal at a restaurant serving guests of Armagh Country Lodge & Spa.
Featured amenities include express check-in, dry cleaning/laundry services, and luggage storage. Free parking is available onsite.
The preferred airport for Armagh Country Lodge & Spa is Port Elizabeth (PLZ) - 159.1 km / 98.8 mi.


text:
Az 1948. évi téli olimpiai játékokon az északi összetett versenyszámát január 31-én és február 1-én rendezték St. Moritzban. A versenyt a finn Heikki Hasu nyerte meg. A versenyszámban nem vett részt magyar versenyző.

Részt vevő nemzetek
A versenyeken 13 nemzet 39 sportolója vett részt.

Éremtáblázat
(Az egyes számoszlopok legmagasabb értéke vagy értékei vastagítással kiemelve.)

Eredmények
A 18 km-es sífutás eredménye alapján és a síugrás két ugrása alapján pontszámokat kaptak a versenyzők. Az összesített pontszámok határozták meg a végső sorrendet.

A távolságok méterben, az időeredmények másodpercben értendők.

Sífutás
A 18 km-es sífutást január 31-én rendezték.

Síugrás
A normálsáncú síugrást február 1-én rendezték.

Ugrásonként csak a távolságadatok ismertek.

* - az ugrás során elesett

Összesítés

Források

Eszakiösszetett
1948