<commit_before>/**
  * Copyright 2015 Otto (GmbH & Co KG)
  *
  * 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 org.schedoscope.scheduler.messages

import akka.actor.ActorRef
import org.joda.time.LocalDateTime
import org.schedoscope.dsl.View
import org.schedoscope.dsl.transformations.Transformation
import org.schedoscope.scheduler.driver._
import org.schedoscope.scheduler.messages.MaterializeViewMode.MaterializeViewMode
import org.schedoscope.scheduler.states.{ViewSchedulingAction, ViewSchedulingState}

/**
  * Superclass for failure messages.
  */
sealed class Failure

/**
  * View actor signals its materialization failure to a waiting view actor
  */
case class ViewFailed(view: View) extends Failure

/**
  * Driver actor signaling a failure of a transfomation that requires a retry by the receiving view actor.
  */
case class TransformationFailure[T <: Transformation](driverRunHandle: DriverRunHandle[T], driverRunState: DriverRunFailed[T]) extends Failure

/**
  * Superclass for commands sent to actors.
  */
sealed class CommandRequest

/**
  * Instructs the partition creator actor to verify or create all Partitions that are specified in any
  * of the views in parameter 'views'
  */
case class AddPartitions(views: List[View]) extends CommandRequest

/**
  * Instructs the partition creator actor to verify or create all tables defined in the specified list of views
  */
case class CheckOrCreateTables(views: List[View]) extends CommandRequest

/**
  * Instructs the metadata logger actor to record the version information of the given view
  * in the metastore.
  */
case class SetViewVersion(view: View) extends CommandRequest

/**
  * Instructs the metadata logger actor to record the timestamp of the last transformation of a
  * given view in the metastore
  */
case class LogTransformationTimestamp(view: View, timestamp: Long) extends CommandRequest

/**
  * Command to kill a running transformation. Actual outcome depends on the ability of the
  * associated driver to be able to do that.
  */
case class KillCommand() extends CommandRequest

/**
  * Command to driver actors to instruct their drivers to deploy their resources (e.g. UDFS) to the distributed file system
  */
case class DeployCommand() extends CommandRequest

/**
  * Used by driver actors to poll the transformation manager actor for a new piece of work to be executed.
  */
case class PollCommand(typ: String) extends CommandRequest

/**
  * Tells a driver actor to execute a transformation.
  * @param transformation to execute
  * @param view to transform
  */
case class TransformView(transformation: Transformation, view: View) extends CommandRequest

/**
  * Instructs a driver actor to perform a command, such as a transformation. It comes along
  * with the reference to the actor that requested the action. The driver actor can then
  * notify the sender about the outcome.
  */<commit_msg>removed forgotten PollCommand msg<commit_after>/**
  * Copyright 2015 Otto (GmbH & Co KG)
  *
  * 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 org.schedoscope.scheduler.messages

import akka.actor.ActorRef
import org.joda.time.LocalDateTime
import org.schedoscope.dsl.View
import org.schedoscope.dsl.transformations.Transformation
import org.schedoscope.scheduler.driver._
import org.schedoscope.scheduler.messages.MaterializeViewMode.MaterializeViewMode
import org.schedoscope.scheduler.states.{ViewSchedulingAction, ViewSchedulingState}

/**
  * Superclass for failure messages.
  */
sealed class Failure

/**
  * View actor signals its materialization failure to a waiting view actor
  */
case class ViewFailed(view: View) extends Failure

/**
  * Driver actor signaling a failure of a transfomation that requires a retry by the receiving view actor.
  */
case class TransformationFailure[T <: Transformation](driverRunHandle: DriverRunHandle[T], driverRunState: DriverRunFailed[T]) extends Failure

/**
  * Superclass for commands sent to actors.
  */
sealed class CommandRequest

/**
  * Instructs the partition creator actor to verify or create all Partitions that are specified in any
  * of the views in parameter 'views'
  */
case class AddPartitions(views: List[View]) extends CommandRequest

/**
  * Instructs the partition creator actor to verify or create all tables defined in the specified list of views
  */
case class CheckOrCreateTables(views: List[View]) extends CommandRequest

/**
  * Instructs the metadata logger actor to record the version information of the given view
  * in the metastore.
  */
case class SetViewVersion(view: View) extends CommandRequest

/**
  * Instructs the metadata logger actor to record the timestamp of the last transformation of a
  * given view in the metastore
  */
case class LogTransformationTimestamp(view: View, timestamp: Long) extends CommandRequest

/**
  * Command to kill a running transformation. Actual outcome depends on the ability of the
  * associated driver to be able to do that.
  */
case class KillCommand() extends CommandRequest

/**
  * Command to driver actors to instruct their drivers to deploy their resources (e.g. UDFS) to the distributed file system
  */
case class DeployCommand() extends CommandRequest

/**
  * Tells a driver actor to execute a transformation.
  * @param transformation to execute
  * @param view to transform
  */
case class TransformView(transformation: Transformation, view: View) extends CommandRequest

/**
  * Instructs a driver actor to perform a command, such as a transformation. It comes along
  * with the reference to the actor that requested the action. The driver actor can then
  * notify the sender about the outcome.
  */
{'fraction_non_alphanumeric': 0.06756352765321375, 'fraction_numerical': 0.002391629297458894, 'mean_word_length': 4.251962323390895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6892759', 'n_tokens_mistral': 1743, 'n_tokens_neox': 1701, 'n_words': 778}