Documentation ¶
Overview ¶
Package processing provides functionality for running a submission and its snapshots through the Impendulo tool suite.
Index ¶
- Constants
- Variables
- func Compiler(p *FileProcessor) (tool.Compiler, error)
- func JPF(p *FileProcessor) (tool.T, error)
- func MonitorStatus() error
- func PMD(p *FileProcessor) (tool.T, error)
- func RunTools(file *project.File, target *tool.Target, p Processor) error
- func Serve(maxProcs uint) error
- func Shutdown() error
- func ShutdownMonitor() error
- func TestTools(p *TestProcessor, tf *project.File) ([]tool.T, error)
- func Tools(p *FileProcessor) ([]tool.T, error)
- type FileProcessor
- func (fp *FileProcessor) Compile(fid bson.ObjectId, t *tool.Target) error
- func (fp *FileProcessor) Process(fid bson.ObjectId) error
- func (fp *FileProcessor) ProcessArchive(a *project.File) error
- func (fp *FileProcessor) ProcessSource(f *project.File) error
- func (fp *FileProcessor) ProcessTest(test *project.File) error
- func (fp *FileProcessor) ResultName(t tool.T) string
- func (fp *FileProcessor) Start(fc chan bson.ObjectId, dc chan util.E)
- func (fp *FileProcessor) StoreFile(n string, d []byte) (*project.File, error)
- func (fp *FileProcessor) Tools() []tool.T
- type Helper
- type Monitor
- type Processor
- type Server
- type TestProcessor
Constants ¶
const (
LOG_PROCESSOR = "processing/processor.go"
)
const (
LOG_SERVER = "processing/server.go"
)
const (
LOG_TOOLS = "processing/tools.go"
)
Variables ¶
var (
MAX_PROCS = max(runtime.NumCPU()-1, 1)
)
Functions ¶
func Compiler ¶
func Compiler(p *FileProcessor) (tool.Compiler, error)
Compiler retrieves a compiler for a Processor's language.
func MonitorStatus ¶
func MonitorStatus() error
MonitorStatus begins keeping track of Impendulo's current processing status.
func RunTools ¶
RunTools runs all available tools on a file. It skips a tool if there is already a result for it present. This makes it possible to rerun old tools or add new tools and run them on old files without having to rerun all the tools.
func Serve ¶
Serve launches the default Server. It listens on the configured AMQP URI and spawns at most maxProcs goroutines in order to process submissions.
Types ¶
type FileProcessor ¶
type FileProcessor struct {
// contains filtered or unexported fields
}
func NewFileProcessor ¶
func NewFileProcessor(sid bson.ObjectId) (*FileProcessor, error)
NewFileProcessor creates a Processor and sets up the environment and tools for it.
func (*FileProcessor) Compile ¶
Compile compiles a file, stores the result and returns any errors which may have occured.
func (*FileProcessor) ProcessArchive ¶
func (fp *FileProcessor) ProcessArchive(a *project.File) error
Extract extracts files from an archive, stores and processes them.
func (*FileProcessor) ProcessSource ¶
func (fp *FileProcessor) ProcessSource(f *project.File) error
ProcessFile extracts archives and runs tools on source files.
func (*FileProcessor) ProcessTest ¶
func (fp *FileProcessor) ProcessTest(test *project.File) error
func (*FileProcessor) ResultName ¶
func (fp *FileProcessor) ResultName(t tool.T) string
func (*FileProcessor) Start ¶
func (fp *FileProcessor) Start(fc chan bson.ObjectId, dc chan util.E)
Process listens for a submission's incoming files and processes them.
func (*FileProcessor) StoreFile ¶
StoreFile creates a new project.File given an encoded file name and file data. The new project.File is then saved in the database.
func (*FileProcessor) Tools ¶
func (fp *FileProcessor) Tools() []tool.T
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper is used to help handle a submission's files.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is used to keep track of and change Impendulo's processing status.
type Processor ¶
type Processor interface { ResultName(tool.T) string Compile(bson.ObjectId, *tool.Target) error Tools() []tool.T Process(bson.ObjectId) error }
Processor is used to process individual submissions.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is our processing server which receives and processes submissions and files.
func NewServer ¶
NewServer constructs a new Server instance which will listen on the coinfigured AMQP URI.
type TestProcessor ¶
type TestProcessor struct {
// contains filtered or unexported fields
}
func NewTestProcessor ¶
func NewTestProcessor(tf *project.File, fp *FileProcessor) (*TestProcessor, error)
func (*TestProcessor) ResultName ¶
func (tp *TestProcessor) ResultName(t tool.T) string
func (*TestProcessor) Tools ¶
func (tp *TestProcessor) Tools() []tool.T