Refactored Android audio artifacts

revert-dabc3590
lasantha 8 years ago
parent f4aad41a34
commit 4e15337655

@ -4,10 +4,10 @@
@Plan:description('Find the audio listening through head set')
@Import('org.wso2.iot.android.audio:1.0.0')
@Import('iot.per.device.stream.android.audio:1.0.0')
define stream AudioStream (meta_owner string, meta_deviceId string, meta_timestamp long, audio_playing bool, headset_on bool, music_volume int);
@Export('org.wso2.iot.android.headset.stats:1.0.0')
@Export('iot.per.device.stream.android.headset.stats:1.0.0')
define stream HeadsetStatsStream (meta_owner string, meta_deviceId string, meta_timestamp long, duration long, year int, month int, day int, hour int, minute int);
partition with (meta_deviceId of AudioStream)

@ -6,10 +6,10 @@
/* define streams/tables and write queries here ... */
@Import('org.wso2.iot.android.audio:1.0.0')
@Import('iot.per.device.stream.android.audio:1.0.0')
define stream AudioStream (meta_owner string, meta_deviceId string, meta_timestamp long, audio_playing bool, headset_on bool, music_volume int);
@Export('org.wso2.iot.android.filtered.audio:1.0.0')
@Export('iot.per.device.stream.android.filtered.audio:1.0.0')
define stream FilteredAudioStream (meta_owner string, meta_deviceId string, meta_timestamp long, audio string, headset string, music_volume int);
from AudioStream select meta_owner, meta_deviceId, meta_timestamp, ifThenElse(audio_playing, 'ON', 'OFF') as audio,

@ -2,7 +2,7 @@
<Analytics>
<Editable>true</Editable>
<Name>AndroidAudioScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidHeadsetData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_ANDROID_HEADSET_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_HEADSET_STATS, DAY");
<Script> CREATE TEMPORARY TABLE AndroidHeadsetData USING CarbonAnalytics OPTIONS(tableName "IOT_PER_DEVICE_STREAM_ANDROID_HEADSET_STATS", incrementalParams "IOT_PER_DEVICE_STREAM_ANDROID_HEADSET_STATS, DAY");
CREATE TEMPORARY TABLE Android_Headset_Stat_Per_Day USING CarbonAnalytics
OPTIONS (tableName "Android_Headset_Stat_Per_Day",
@ -15,7 +15,7 @@
FROM AndroidHeadsetData
GROUP BY year, month, day, meta_deviceId, meta_owner ORDER BY timestamp DESC;
INCREMENTAL_TABLE_COMMIT ORG_WSO2_IOT_ANDROID_HEADSET_STATS;
INCREMENTAL_TABLE_COMMIT IOT_PER_DEVICE_STREAM_ANDROID_HEADSET_STATS;
</Script>
<CronExpression>0 0/5 * * * ?</CronExpression>
</Analytics>

@ -18,6 +18,6 @@
-->
<artifact name= "android_audio_streams" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.android.audio_1.0.0.json</file>
<file>iot.per.device.stream.android.audio_1.0.0.json</file>
</artifact>

Loading…
Cancel
Save