.. index:: crashmover

.. _crashmover-chapter:

Crash Mover
===========

The :ref:`collector-chapter` dumps all the crashes that it receives into the
local file system. This application is responsible for transferring
those crashes into hbase.

**Configuration**::

 import stat
 import socorro.lib.ConfigurationManager as cm

 #-------------------------------------------------------------------------------
 # general

 numberOfThreads = cm.Option()
 numberOfThreads.doc = 'the number of threads to use'
 numberOfThreads.default = 4

 #-------------------------------------------------------------------------------
 # source storage

 sourceStorageClass = cm.Option()
 sourceStorageClass.doc = 'the fully qualified name of the source storage class'
 sourceStorageClass.default = 'socorro.storage.crashstorage.CrashStorageSystemForLocalFS'
 sourceStorageClass.fromStringConverter = cm.classConverter

 from config.collectorconfig import localFS
 from config.collectorconfig import localFSDumpDirCount
 from config.collectorconfig import localFSDumpGID
 from config.collectorconfig import localFSDumpPermissions
 from config.collectorconfig import localFSDirPermissions
 from config.collectorconfig import fallbackFS
 from config.collectorconfig import fallbackDumpDirCount
 from config.collectorconfig import fallbackDumpGID
 from config.collectorconfig import fallbackDumpPermissions
 from config.collectorconfig import fallbackDirPermissions

 from config.commonconfig import jsonFileSuffix
 from config.commonconfig import dumpFileSuffix

 #-------------------------------------------------------------------------------
 # destination storage

 destinationStorageClass = cm.Option()
 destinationStorageClass.doc = 'the fully qualified name of the source storage class'
 destinationStorageClass.default = 'socorro.storage.crashstorage.CrashStorageSystemForHBase'
 destinationStorageClass.fromStringConverter = cm.classConverter

 from config.commonconfig import hbaseHost
 from config.commonconfig import hbasePort
 from config.commonconfig import hbaseTimeout

 #-------------------------------------------------------------------------------
 # logging

 syslogHost = cm.Option()
 syslogHost.doc = 'syslog hostname'
 syslogHost.default = 'localhost'

 syslogPort = cm.Option()
 syslogPort.doc = 'syslog port'
 syslogPort.default = 514

 syslogFacilityString = cm.Option()
 syslogFacilityString.doc = 'syslog facility string ("user", "local0", etc)'
 syslogFacilityString.default = 'user'

 syslogLineFormatString = cm.Option()
 syslogLineFormatString.doc = 'python logging system format for syslog entries'
 syslogLineFormatString.default = 'Socorro Storage Mover (pid %(process)d): %(asctime)s %(levelname)s - %(threadName)s - %(message)s'

 syslogErrorLoggingLevel = cm.Option()
 syslogErrorLoggingLevel.doc = 'logging level for the log file (10 - DEBUG, 20 - INFO, 30 - WARNING, 40 - ERROR, 50 - CRITICAL)'
 syslogErrorLoggingLevel.default = 10

 stderrLineFormatString = cm.Option()
 stderrLineFormatString.doc = 'python logging system format for logging to stderr'
 stderrLineFormatString.default = '%(asctime)s %(levelname)s - %(threadName)s - %(message)s'

 stderrErrorLoggingLevel = cm.Option()
 stderrErrorLoggingLevel.doc = 'logging level for the logging to stderr (10 - DEBUG, 20 - INFO, 30 - WARNING, 40 - ERROR, 50 - CRITICAL)'
 stderrErrorLoggingLevel.default = 10
