This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE REVIVE_AD_VIS; | |
CREATE EXTERNAL TABLE REVIVE_AD_VIS ( hour String, bannerid STRING, campaignid STRING, zoneid STRING, count STRING ) | |
row format | |
delimited fields terminated by ',' | |
lines terminated by '\n' | |
STORED | |
AS TEXTFILE LOCATION 's3n://EMRresult/OutputFolder'; | |
INSERT OVERWRITE TABLE REVIVE_AD_VIS | |
SELECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* same as SimpleChunkProcessor except otherwise shown | |
*/ | |
public class ConcurrentChunkProcessor<I, O> implements ChunkProcessor<I>, InitializingBean { | |
// ... | |
// example of parallel processing using Executor service, better create this by Spring and inject if available or | |
// use the same TaskExecutor from the Context | |
private static final int THREADPOOL_TIMEOUT_IN_SECONDS = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!$user = $this->db->get("user",array("api"=>"?"),array("limit"=>1),array($key))) return $this->api_build(array("error"=>1,"msg"=>"A valid API key is required to use this service.")); | |
$this->userid = $user->id; | |
$this->customDomain = $user->domain; | |
// Check Request type | |
if(!isset($_GET["url"]) && !isset($_GET["short"])) return $this->api_build(array("error"=>1,"msg"=>"Please enter a valid URL.")); | |
// Check if shorten request is made | |
if(isset($_GET["url"])){ | |
$array = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration debug="false"> | |
<!-- if-then-else form --> | |
<if condition='property("profile").contains("PROD")'> | |
<then> | |
<property name="LOGGER_LEVEL" value="INFO" /> | |
<property name="CONSOLE_LOGGER_LEVEL" value="WARN" /> | |
</then> | |
<else> | |
<property name="LOGGER_LEVEL" value="INFO" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserRequiredAnnotationInterceptor extends HandlerInterceptorAdapter | |
{ | |
@Override | |
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception | |
{ | |
if (handler == null) | |
{ | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserRequiredAnnotationInterceptor extends HandlerInterceptorAdapter | |
{ | |
@Override | |
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception | |
{ | |
if (handler == null) | |
{ | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bemobi.wap.config; | |
import java.util.Properties; | |
import javax.persistence.EntityManagerFactory; | |
import javax.sql.DataSource; | |
import org.hibernate.ejb.HibernatePersistence; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For<IRepository<TipoServico>>().Use<Repository<TipoServico>>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using workshop_httpmodule; | |
namespace Workshop.Data.NHibernate | |
{ | |
public class GenericRepository<T> : IRepository<T> | |
{ | |
public T Save(T entity) | |
{ | |
NHibernateHttpModule.RecuperarSessao.Save(entity); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace Workshop.Data | |
{ | |
public interface IRepository<T> | |
{ | |
T Save(T entity); | |
T Update(T entity); | |
void Delete(T entity); | |
T ById(int id); |